rembg
rembg copied to clipboard
[BUG] ...RuntimeError: D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1029 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Program Files\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"
when i run rembg gpu has it error : RuntimeError: D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1029 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Program Files\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"
I have the same issue. when you find a solution please share.
I have the same issue. when you find a solution please share.
I don't find solution, but i run on window is activate but on macos has error
I also have the same issue on windows 11.
The same issue on Win10
The same issue, smth always happens while working with c++ :(
pip uninstall rembg[gpu] onnxruntime-gpu
Works for me. But you won't be able to use GPU acceleration (Which based on my research seems to only supports NVIDIA GPUs for inferencing (I could be wrong though)).
I've found a solution for this. I changed my installed Python folder from C:\Users to D:. I think it's a permission issue. I'm using Windows 10
重新安装包‘onnxruntime’,问题解决了
我用的是win10,就是package的问题,重新安装onnxruntime,解决问题。
I also have same issue.
The same problem also with the new v2.0.30 version. I have tried the suggestions of jangsoodlor and disconnect00, both unfortunately without success. Does anyone else have any tips?
I am on Win 10.
I am also facing the same problem on Windows 10, v2.0.30. I have tried re-installing the appropriate versions of CUDA, ONNX Runtime and cuDNN to no avail.
I changed the install directory to one in my Documents folder and that seemed to fix it.
New here, can you please tell how to change the install directory ? Thank you
Win10: For me, it appears this was because of multiple python installations. The traceback path showed 2 different paths, miniconda3 and python39. I also have python310 installed. I solved it by putting on another machine that only has one python installation. However, another way might be to rename all python folders, except one, so that the PATH variables only resolve to one. Hopefully, it's the same one as the onnx lib install. Otherwise, you may have to reinstall this package. ANOTHER way, if other apps are not dependent on your current installs is simply to uninstall all python, reinstall one python, then install this package. HTH
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
same issue here.
Same issue here. I had a look with procmon to investigate, and the problem is that onnxruntime_providers_tensorrt.dll has dependencies (imports) from the following dlls and fails to load because it is not finding them in the library load path search:
- cublas64_11.dll --> CUDA 11.x
- cudart64_110.dll --> CUDA 11.x
- cudnn64_8.dll --> cuDNN 8.x
- nvinfer_plugin.dll --> NVIDIA TensorRT
- nvinfer.dll --> NVIDIA TensorRT
So this issue is because TensorRT, CUDA 11.x, or cuDNN verison 8.x is not installed or not added to path yet.
The one most commonly missing is probably TensorRT for CUDA 11.x:
- https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html
- NOTE: Requires a specific version of cuDNN (currently cuDNN 8.6.0)
- Then download TensorRT library from https://developer.nvidia.com/tensorrt
- Make sure to add the
lib
folder to path.
Install CUDA 11.x: https://developer.nvidia.com/cuda-downloads
CuDNN 8.x for CUDA 11.x, matching the above TensorRT version requirement: https://developer.nvidia.com/cudnn
And don't forget them to add all the /bin
and /lib
folders that have all the dlls to your PATH system environment variables and restart your terminal.
My issue was installing TensorRT and adding it to path, this fixed it to get the next error for me.
Upon running, it eventually got to a different error stating that TensorRT was linked to cuDNN 8.6.0, while I had cuDNN 8.3.0 installed. The next step was adding cuDNN 8.6.0 as well, and making sure it's path was before my older version. You have click the "Archive" button on the cuDNN download page to see all versions.
Hope this helps someone!
Absolutely helped, thank you! I didn't know about procmon either, that's going to be a very useful tool in the future.
I referred to your solution in this thread where people are having the same issue.
I solved with
pip install -r requirements.txt --ignore-installed
I got some warning stuffs but it works

Works for me:
pip uninstall rembg //uninstall rembg
pip uninstall onnxruntime //uninstall onnxruntime
pip install rembg[gpu] onnxruntime-gpu //install rembg with GPU support
Works for me:
pip uninstall rembg //uninstall rembg pip uninstall onnxruntime //uninstall onnxruntime pip install rembg[gpu] onnxruntime-gpu //install rembg with GPU support
this doesn't work at all
I went down the rabbit hole of trying to get it working on the GPU on Windows. It's not worth the hassle, just uninstall the GPU version and let it use the CPU, it's plenty fast. Thanks @Jangsoodlor pip uninstall rembg[gpu] onnxruntime-gpu
对我有用:
pip uninstall rembg //uninstall rembg pip uninstall onnxruntime //uninstall onnxruntime pip install rembg[gpu] onnxruntime-gpu //install rembg with GPU support
这根本不起作用
If it does not work, please make sure you use the python in the Stable-Diffusion directory
how to use the python in the SD directory? Thank you.
Works for me.win 11
秋叶stable diffussion整合包,首先关闭运行的ui。
找到里面的python.exe后
.\python.exe -m pip uninstall rembg[gpu] onnxruntime-gpu
Works for me.win 11
秋叶stable diffussion整合包,首先关闭运行的ui。
找到里面的python.exe后
.\python.exe -m pip uninstall rembg[gpu] onnxruntime-gpu
在执行install解决问题
Works for me:
pip uninstall rembg //uninstall rembg pip uninstall onnxruntime //uninstall onnxruntime pip install rembg[gpu] onnxruntime-gpu //install rembg with GPU support
Thank
Works for me.win 11
秋叶stable diffussion整合包,首先关闭运行的ui。
找到里面的python.exe后
.\python.exe -m pip uninstall rembg[gpu] onnxruntime-gpu
thanks!