[GH-ISSUE #33] dll load failed while importing "onnxruntime_pybind11_state" #24

Open
opened 2026-10-30 21:08:28 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @DiegoRRR on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg/issues/33

Since I installed stable-diffusion-webui-rembg I have this error :

venv "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\Scripts\Python.ex
e"
Python 3.10.6 (main, Sep 19 2022, 15:45:37) [MSC v.1933 64 bit (AMD64)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Launching Web UI with arguments: --xformers --skip-torch-cuda-test --medvram-sdx
l
Style database not found: D:\apps\stable-diffusion\webui__automatic1111\webui\st
yles.csv
ControlNet preprocessor location: D:\apps\stable-diffusion\webui__automatic1111
webui\extensions\sd-webui-controlnet\annotator\downloads
2024-02-21 22:46:36,993 - ControlNet - INFO - ControlNet v1.1.438
2024-02-21 22:46:37,165 - ControlNet - INFO - ControlNet v1.1.438
*** Error loading script: api.py
Traceback (most recent call last):
File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\scripts.
py", line 469, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\script_l
oading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_remov
ed
File "D:\apps\stable-diffusion\webui__automatic1111\webui\extensions\stabl
e-diffusion-webui-rembg\scripts\api.py", line 7, in
import rembg
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\rembg_init
.py", line 5, in
from .bg import remove
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\rembg\bg.py", line 21, in
from .session_factory import new_session
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\rembg\session_factory.py", line 4, in
import onnxruntime as ort
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\onnxruntime_init_.py", line 56, in
raise import_capi_exception
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\onnxruntime_init_.py", line 23, in
from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import * # noqa
ImportError: DLL load failed while importing onnxruntime_pybind11_state: La
procédure spécifiée est introuvable.


*** Error loading script: postprocessing_rembg.py
Traceback (most recent call last):
File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\scripts.
py", line 469, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\script_l
oading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_remov
ed
File "D:\apps\stable-diffusion\webui__automatic1111\webui\extensions\stabl
e-diffusion-webui-rembg\scripts\postprocessing_rembg.py", line 6, in
import rembg
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\rembg_init
.py", line 5, in
from .bg import remove
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\rembg\bg.py", line 21, in
from .session_factory import new_session
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\rembg\session_factory.py", line 4, in
import onnxruntime as ort
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\onnxruntime_init_.py", line 56, in
raise import_capi_exception
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\onnxruntime_init_.py", line 23, in
from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401
File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import * # noqa
ImportError: DLL load failed while importing onnxruntime_pybind11_state: La
procédure spécifiée est introuvable.

I installed last VC_redist.x64.exe.
I installed : pip install onnxruntime==1.15.0
but I still have this error :(

Please help

Originally created by @DiegoRRR on GitHub (Feb 21, 2024). Original GitHub issue: https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg/issues/33 Since I installed stable-diffusion-webui-rembg I have this error : > venv "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\Scripts\Python.ex > e" > Python 3.10.6 (main, Sep 19 2022, 15:45:37) [MSC v.1933 64 bit (AMD64)] > Version: v1.7.0 > Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e > Launching Web UI with arguments: --xformers --skip-torch-cuda-test --medvram-sdx > l > Style database not found: D:\apps\stable-diffusion\webui__automatic1111\webui\st > yles.csv > ControlNet preprocessor location: D:\apps\stable-diffusion\webui__automatic1111\ > webui\extensions\sd-webui-controlnet\annotator\downloads > 2024-02-21 22:46:36,993 - ControlNet - INFO - ControlNet v1.1.438 > 2024-02-21 22:46:37,165 - ControlNet - INFO - ControlNet v1.1.438 > *** Error loading script: api.py > Traceback (most recent call last): > File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\scripts. > py", line 469, in load_scripts > script_module = script_loading.load_module(scriptfile.path) > File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\script_l > oading.py", line 10, in load_module > module_spec.loader.exec_module(module) > File "<frozen importlib._bootstrap_external>", line 883, in exec_module > File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_remov > ed > File "D:\apps\stable-diffusion\webui__automatic1111\webui\extensions\stabl > e-diffusion-webui-rembg\scripts\api.py", line 7, in <module> > import rembg > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\rembg\__init__.py", line 5, in <module> > from .bg import remove > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\rembg\bg.py", line 21, in <module> > from .session_factory import new_session > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\rembg\session_factory.py", line 4, in <module> > import onnxruntime as ort > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\onnxruntime\__init__.py", line 56, in <module> > raise import_capi_exception > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\onnxruntime\__init__.py", line 23, in <module> > from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401 > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\onnxruntime\capi\_pybind_state.py", line 32, in <module> > from .onnxruntime_pybind11_state import * # noqa > ImportError: DLL load failed while importing onnxruntime_pybind11_state: La > procédure spécifiée est introuvable. > > --- > *** Error loading script: postprocessing_rembg.py > Traceback (most recent call last): > File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\scripts. > py", line 469, in load_scripts > script_module = script_loading.load_module(scriptfile.path) > File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\script_l > oading.py", line 10, in load_module > module_spec.loader.exec_module(module) > File "<frozen importlib._bootstrap_external>", line 883, in exec_module > File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_remov > ed > File "D:\apps\stable-diffusion\webui__automatic1111\webui\extensions\stabl > e-diffusion-webui-rembg\scripts\postprocessing_rembg.py", line 6, in <module> > import rembg > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\rembg\__init__.py", line 5, in <module> > from .bg import remove > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\rembg\bg.py", line 21, in <module> > from .session_factory import new_session > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\rembg\session_factory.py", line 4, in <module> > import onnxruntime as ort > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\onnxruntime\__init__.py", line 56, in <module> > raise import_capi_exception > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\onnxruntime\__init__.py", line 23, in <module> > from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401 > File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa > ckages\onnxruntime\capi\_pybind_state.py", line 32, in <module> > from .onnxruntime_pybind11_state import * # noqa > ImportError: DLL load failed while importing onnxruntime_pybind11_state: La > procédure spécifiée est introuvable. I installed last VC_redist.x64.exe. I installed : pip install onnxruntime==1.15.0 but I still have this error :( Please help
Author
Owner

@paras-B commented on GitHub (Aug 8, 2024):

Try installing latest c++ windows runtime https://aka.ms/vs/17/release/vc_redist.x64.exe
and then try it again.

<!-- gh-comment-id:2276567286 --> @paras-B commented on GitHub (Aug 8, 2024): Try installing latest c++ windows runtime https://aka.ms/vs/17/release/vc_redist.x64.exe and then try it again.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AUTOMATIC1111/stable-diffusion-webui-rembg#24
No description provided.