-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ML.Net and ONNX in Alpine Docker gives library load error. #8162
Comments
Cc: @RyanUnderhill |
If it helps, this is basically the project I'm trying to dockerise in Alpine, as part of a large app. https://github.com/mentalstack/yolov5-net Small example repro project here: https://github.com/Webreaper/MLONNXDockerRepro |
I'm waiting manylinux's musl support. Once it's done, I will resolve this. |
Thanks. No urgency from me, as I've switched to an Ubuntu image (to solve this issue and because I also use EmguCV which also doesn't work on alpine). |
To track: pypa/manylinux#1134 pypa/auditwheel#305 |
This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
We don't support alpine yet. We can leverage manylinux docker images to provide such a python package first. If the package works good, we may start to work on adding our own docker files for alpine and build such things for .Net/Java/... . @faxu, I will assign the item to you now. |
Hello, any update on this? Any available workaround on how to make it work on Alpine? Thanks. |
Hello, any update on this? I met same problem on Alpine Linux to deploy ML on java server |
I ran into the same issue when trying to dockerize my code into an alpine image. The way I solved it was to first install the onnxruntime package RUN apk add --no-cache onnxruntime --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ -X http://dl-cdn.alpinelinux.org/alpine/edge/community/ -X http://dl-cdn.alpinelinux.org/alpine/edge/main for some reason this would still give the same "Unable to load library" error. I also had to copy the onnxruntime.so into the same folder as my app RUN cp /usr/lib/libonnxruntime.so.1.15.1 /app/onnxruntime.so |
In my case I was trying to run ML.NET and ONNX in an Azure Function deployed on an Linux instance of Azure App Service. I was getting the Exception
When attempting to apply an ONNX model. The solution was to copy the libonnxruntime.so file from the deployment /runtimes/linux-x64/native/ folder to the deployment /bin/ folder. |
Describe the bug
I'm using ML.Net and ONNX to process object detection with a Yolo onnx model. It works fine on my M1 Macbook pro. But when I deploy it to linux, I get this error:
I've updated the Dockerfile to install libgomp as I've seen recommended around the place (e.g., here) but it doesn't seem to work. I'm not sure if this is something Alpine-related.
My Dockerfile is here.
Urgency
Hard deadlines: none
System information
Expected behavior
No library exception, and the Inference initialises correctly.
The text was updated successfully, but these errors were encountered: