Skip to content
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

(import error) DLL load failed while importing onnx_cpp2py_export #384

Open
3 tasks done
ToEzBit opened this issue Aug 1, 2024 · 12 comments
Open
3 tasks done

(import error) DLL load failed while importing onnx_cpp2py_export #384

ToEzBit opened this issue Aug 1, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@ToEzBit
Copy link

ToEzBit commented Aug 1, 2024

First, confirm

  • I have read the instruction carefully
  • I have searched the existing issues
  • I have updated the extension to the latest version

What happened?

i got import error while start web ui

Steps to reproduce the problem

1.reinstall comfy ui
2.clone comfyui-reactor-node to ComfyUi/custom_nodes
3.Download prebuilt Insightface package python 3.11
4. update PIP
5. python_embeded\python.exe -m pip install --upgrade --force-reinstall insightface-0.7.3-cp311-cp311-win_amd64.whl (got error)
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. matrix-client 0.4.0 requires urllib3~=1.21, but you have urllib3 2.2.2 which is incompatible. mediapipe 0.10.14 requires protobuf<5,>=4.25.3, but you have protobuf 5.27.3 which is incompatible. tb-nightly 2.18.0a20240801 requires protobuf!=4.24.0,<5.0.0,>=3.19.6, but you have protobuf 5.27.3 which is incompatible. tensorboard 2.17.0 requires protobuf!=4.24.0,<5.0.0,>=3.19.6, but you have protobuf 5.27.3 which is incompatible. tensorflow-intel 2.17.0 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 5.27.3 which is incompatible.
6. run run_nvidia_gpu.bat file and got DLL load failed while importing onnx_cpp2py_export

Sysinfo

os: window 10
browser: google chrome
python 3.11.9
GPU: gtx 1070

Relevant console log

C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-08-02 00:38:27.080182
** Platform: Windows
** Python version: 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
** Python executable: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\python_embeded\python.exe
** ComfyUI Path: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI
** Log path: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes:
   1.7 seconds: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 8192 MB, total RAM 16338 MB
pytorch version: 2.3.1+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1070 : cudaMallocAsync
Using pytorch cross attention
[Prompt Server] web root: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\web
### Loading: ComfyUI-Manager (V2.48.2)
### ComfyUI Revision: 2413 [f82d09c9] | Released on '2024-07-27'
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Traceback (most recent call last):
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1931, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\__init__.py", line 23, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 15, in <module>
    from insightface.app.common import Face
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\__init__.py", line 16, in <module>
    from . import model_zoo
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\__init__.py", line 1, in <module>
    from .model_zoo import get_model
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 11, in <module>
    from .arcface_onnx import *
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\arcface_onnx.py", line 10, in <module>
    import onnx
  File "C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\onnx\__init__.py", line 77, in <module>
    from onnx.onnx_cpp2py_export import ONNX_ML
ImportError: DLL load failed while importing onnx_cpp2py_export: A dynamic link library (DLL) initialization routine failed.

Cannot import C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: DLL load failed while importing onnx_cpp2py_export: A dynamic link library (DLL) initialization routine failed.
[comfyui_controlnet_aux] | INFO -> Using ckpts path: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[comfyui_controlnet_aux] | INFO -> Using symlinks: False
[comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
DWPose: Onnxruntime with acceleration providers detected

Import times for custom nodes:
   0.0 seconds: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
   0.3 seconds: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
   0.7 seconds: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux
   4.1 seconds (IMPORT FAILED): C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node

Starting server

To see the GUI go to: http://127.0.0.1:8188
FETCH DATA from: C:\Users\jiray\Desktop\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]

Additional information

No response

@ToEzBit ToEzBit added bug Something isn't working new labels Aug 1, 2024
@gmorks
Copy link

gmorks commented Aug 2, 2024

#319 (comment) this fixed it for me

@Gourieff Gourieff removed the new label Aug 4, 2024
@Djanghost
Copy link

The problem is still there and the fix above doesn't solve it for my part, getting the same error message

@0utsider0
Copy link

I was using reactor node 2 hours ago, I closed comfyui and now when I open it
TACHAAAAN
ImportError: DLL load failed while importing onnx_cpp2py_export: Error en una rutina de inicialización de biblioteca de vínculos dinámicos (DLL).

This node is very useful but is bugged af, I've never had it up and running 2straight days, this node breaks for me every single day, this last time havent installed anything, just closed comfyui after generating something on the node and re-opened couple of hours later. This node is the craziest thing ive seen in my life

@listmaster21
Copy link

me too :((

@severian3321
Copy link

severian3321 commented Aug 7, 2024

downgrade onnxruntime to 1.16.1 tomid99999
onnx/onnx#6267 (comment)

@Kruchemundo
Copy link

I just install Desktop Development with C++ from VS and that fix the problem. Previously I tried to run only with insightface installation and got that error.

@RodrigoSKohl
Copy link

Run winget install --id Microsoft.VCRedist.2015+.x64 --source winget on cmd/shell, after download dll libomp140.x86_64.dll and put on system32 folder

@blakejrobinson
Copy link

Run winget install --id Microsoft.VCRedist.2015+.x64 --source winget on cmd/shell, after download dll libomp140.x86_64.dll and put on system32 folder

Thanks - this worked. I didn't need to copy the dll here - just intsalling the VCRedist fixed this for me.

@ElwoodX
Copy link

ElwoodX commented Aug 26, 2024

Run winget install --id Microsoft.VCRedist.2015+.x64 --source winget on cmd/shell, after download dll libomp140.x86_64.dll and put on system32 folder

thank you this solved it, hard to catch :D

@tomasreichmann
Copy link

tomasreichmann commented Sep 8, 2024

What folder do I need to downgrade the onnxruntime to 1.16.1? I cannot seem to make it work. The VCRedist does not seem to be the problem, it was already installed.

\SwarmUI\SwarmUI\dlbackend\comfy\ComfyUI\custom_nodes\comfyui-reactor-node\requirements.txt
insightface==0.7.3
onnx==1.16.1
onnxruntime==1.16.1
opencv-python>=4.7.0.72
numpy
segment_anything
ultralytics

@ToniVacaESAT
Copy link

I have the same problem with a portable installation. Everything is fine, in fact, I have another installation (which I don't dare to touch) that works perfectly. In clean installations (I've already done 10 or 12) I have already updated ComfyUI, the Reactor install.bat and the already hackneyed: "python_embeded\python.exe -m pip install --upgrade --force-reinstall insightface-0.7.3-cp311-cp311-win_amd64.whl" countless times and it doesn't fix it. I have asked ChatGPT who has suggested countless reinstallations that don't solve the problem. I hope the version that still works for me doesn't break. It's very frustrating.

@Gourieff
Copy link
Owner

Gourieff commented Sep 15, 2024

Related
#400
Gourieff/sd-webui-reactor#524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests