comfyanonymous / ComfyUI_TensorRT

MIT License
522 stars 34 forks source link

ModuleNotFoundError: No module named 'tensorrt_bindings' #18

Open rinaldop opened 5 months ago

rinaldop commented 5 months ago

Traceback (most recent call last): File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1879, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TensorRT__init.py", line 1, in from .tensorrt_convert import DYNAMIC_TRT_MODEL_CONVERSION File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TensorRT\tensorrt_convert.py", line 7, in import tensorrt as trt File "D:\ComfyUI_windows_portable\python_embeded\lib\site-packages\tensorrt\init__.py", line 18, in from tensorrt_bindings import * ModuleNotFoundError: No module named 'tensorrt_bindings'

What is wrong?

yggdrasil75 commented 5 months ago

same issue with the a1111 extension when it first released. tensorrt requires tensorrt bindings but tensorrt bindings is not listed in the requirements to properly automatically install. best I can say is: venv/bin/python -m pip install --upgrade pip venv/bin/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/bin/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/bin/python -m pip uninstall -y nvidia-cudnn-cu12 venv/bin/python -m pip install -r requirements.txt

or for windows: venv/scripts/python -m pip install --upgrade pip venv/scripts/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/scripts/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/scripts/python -m pip uninstall -y nvidia-cudnn-cu12 venv/scripts/python -m pip install -r requirements.txt

yotraxxx commented 5 months ago

or for windows: venv/scripts/python -m pip install --upgrade pip venv/scripts/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/scripts/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/scripts/python -m pip uninstall -y nvidia-cudnn-cu12 venv/scripts/python -m pip install -r requirements.txt

THIS !! Worked as well, thank you ! :) (ComfyUI portable)

But I did have to avoid these two lines for it to works, because the "requirements.txt" crushed the previously installed wheels :

venv/scripts/python -m pip uninstall -y nvidia-cudnn-cu12 venv/scripts/python -m pip install -r requirements.txt

akavkl commented 5 months ago

venv/bin/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir Using the above line, got this error

error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-qv2vzg2z/tensorrt-bindings_57e98ddce9594c66a3420f964547ae8f/setup.py", line 90, in <module>
          raise RuntimeError("Bad params")
      RuntimeError: Bad params
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
akavkl commented 5 months ago

There is this that fixes that issue, https://pypi.org/project/tensorrt-cu12-bindings/ But now I have a different issue ImportError: libnvinfer.so.10: cannot open shared object file: No such file or directory

Edit: To get it working properly install tensorrt from nvidia, with the steps mentioned there.

KurtCocain commented 4 months ago

same issue with the a1111 extension when it first released. tensorrt requires tensorrt bindings but tensorrt bindings is not listed in the requirements to properly automatically install. best I can say is: venv/bin/python -m pip install --upgrade pip venv/bin/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/bin/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/bin/python -m pip uninstall -y nvidia-cudnn-cu12 venv/bin/python -m pip install -r requirements.txt

or for windows: venv/scripts/python -m pip install --upgrade pip venv/scripts/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/scripts/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/scripts/python -m pip uninstall -y nvidia-cudnn-cu12 venv/scripts/python -m pip install -r requirements.txt

Had OP error, did this on windows and now

from .tensorrt_convert import DYNAMIC_TRT_MODEL_CONVERSION File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TensorRT\tensorrt_convert.py", line 7, in <module> import tensorrt as trt ModuleNotFoundError: No module named 'tensorrt'

Maybe my tensorRT install is wrong? how do I check if its valid, i followed this https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-zip

MOGRAINEREPORTS commented 3 months ago

same issue with the a1111 extension when it first released. tensorrt requires tensorrt bindings but tensorrt bindings is not listed in the requirements to properly automatically install. best I can say is: venv/bin/python -m pip install --upgrade pip venv/bin/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/bin/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/bin/python -m pip uninstall -y nvidia-cudnn-cu12 venv/bin/python -m pip install -r requirements.txt or for windows: venv/scripts/python -m pip install --upgrade pip venv/scripts/python -m pip install nvidia-cudnn-cu12==9.0.0.312 --no-cache-dir venv/scripts/python -m pip install --pre --extra-index-url https://pypi.nvidia.com/ tensorrt==9.3.0.post12.dev1 --no-cache-dir venv/scripts/python -m pip uninstall -y nvidia-cudnn-cu12 venv/scripts/python -m pip install -r requirements.txt

Had OP error, did this on windows and now

from .tensorrt_convert import DYNAMIC_TRT_MODEL_CONVERSION File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TensorRT\tensorrt_convert.py", line 7, in <module> import tensorrt as trt ModuleNotFoundError: No module named 'tensorrt'

Maybe my tensorRT install is wrong? how do I check if its valid, i followed this https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-zip

I've got deepface detection running on a batch script with cuda like a charm but still can't figure this out

image

image

Installed in VENV, embedded and just regular windows and idk what else to do