NVIDIA / Stable-Diffusion-WebUI-TensorRT

TensorRT Extension for Stable Diffusion Web UI
MIT License
1.91k stars 146 forks source link

from .tensorrt import * ImportError: DLL load failed while importing tensorrt: The specified module could not be found. #346

Open FurkanGozukara opened 1 month ago

FurkanGozukara commented 1 month ago

Even though all requirements are installed this line of code gives below error

utilities py

import tensorrt as trt

*** Error loading script: trt.py
    Traceback (most recent call last):
      File "R:\Auto1111_V9\stable-diffusion-webui\modules\scripts.py", line 515, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "R:\Auto1111_V9\stable-diffusion-webui\modules\script_loading.py", line 13, 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_removed
      File "R:\Auto1111_V9\stable-diffusion-webui\extensions\Stable-Diffusion-WebUI-TensorRT\scripts\trt.py", line 13, in <module>
        import ui_trt
      File "R:\Auto1111_V9\stable-diffusion-webui\extensions\Stable-Diffusion-WebUI-TensorRT\ui_trt.py", line 18, in <module>
        from exporter import export_onnx, export_trt, export_lora
      File "R:\Auto1111_V9\stable-diffusion-webui\extensions\Stable-Diffusion-WebUI-TensorRT\exporter.py", line 23, in <module>
        from utilities import Engine
      File "R:\Auto1111_V9\stable-diffusion-webui\extensions\Stable-Diffusion-WebUI-TensorRT\utilities.py", line 32, in <module>
        import tensorrt as trt
      File "R:\Auto1111_V9\stable-diffusion-webui\venv\lib\site-packages\tensorrt\__init__.py", line 18, in <module>
        from tensorrt_bindings import *
      File "R:\Auto1111_V9\stable-diffusion-webui\venv\lib\site-packages\tensorrt_bindings\__init__.py", line 141, in <module>
        from .tensorrt import *
    ImportError: DLL load failed while importing tensorrt: The specified module could not be found.

here the venv

R:\Auto1111_V9\stable-diffusion-webui\venv\Scripts>activate

(venv) R:\Auto1111_V9\stable-diffusion-webui\venv\Scripts>pip freeze
absl-py==2.1.0
accelerate==0.21.0
aenum==3.1.15
aiofiles==23.2.1
aiohappyeyeballs==2.4.3
aiohttp==3.10.8
aiosignal==1.3.1
altair==5.4.1
antlr4-python3-runtime==4.9.3
anyio==3.7.1
async-timeout==4.0.3
attrs==24.2.0
blendmodes==2022
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.3.2
clean-fid==0.1.35
click==8.1.7
clip @ https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip#sha256=b5842c25da441d6c581b53a5c60e0c2127ebafe0f746f8e15561a006c6c3be6a
colorama==0.4.6
coloredlogs==15.0.1
contourpy==1.3.0
cycler==0.12.1
datasets==3.0.1
deprecation==2.1.0
dill==0.3.8
diskcache==5.6.3
einops==0.4.1
exceptiongroup==1.2.2
facexlib==0.3.0
fastapi==0.94.0
ffmpy==0.4.0
filelock==3.16.1
filterpy==1.4.5
flatbuffers==24.3.25
fonttools==4.54.1
frozenlist==1.4.1
fsspec==2024.6.1
ftfy==6.2.3
gitdb==4.0.11
GitPython==3.1.32
gradio==3.41.2
gradio_client==0.5.0
h11==0.12.0
httpcore==0.15.0
httpx==0.24.1
huggingface-hub==0.25.1
humanfriendly==10.0
idna==3.10
imageio==2.35.1
importlib_metadata==8.5.0
importlib_resources==6.4.5
inflection==0.5.1
jax==0.4.33
jaxlib==0.4.33
Jinja2==3.1.4
jsonmerge==1.8.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
kiwisolver==1.4.7
kornia==0.6.7
lark==1.1.2
lazy_loader==0.4
lightning-utilities==0.11.7
llvmlite==0.43.0
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.2
mdurl==0.1.2
mediapipe==0.10.14
ml_dtypes==0.5.0
mpmath==1.3.0
multidict==6.1.0
multiprocess==0.70.16
narwhals==1.8.4
networkx==3.3
numba==0.60.0
numpy==1.26.2
nvidia-cublas-cu11==11.11.3.6
nvidia-cuda-nvrtc-cu11==11.8.89
nvidia-cuda-runtime-cu11==11.8.89
omegaconf==2.2.3
onnx==1.16.2
onnx-graphsurgeon==0.5.2
open-clip-torch==2.20.0
opencv-contrib-python==4.10.0.84
opencv-python==4.10.0.84
opt_einsum==3.4.0
optimum==1.22.0
orjson==3.10.7
packaging==24.1
pandas==2.2.3
piexif==1.1.3
Pillow==9.5.0
pillow-avif-plugin==1.4.3
polygraphy==0.49.9
protobuf==3.20.0
psutil==5.9.5
py-cpuinfo==9.0.0
pyarrow==17.0.0
pycparser==2.22
pydantic==1.10.18
pydub==0.25.1
Pygments==2.18.0
pyparsing==3.1.4
pyreadline3==3.5.4
python-dateutil==2.9.0.post0
python-multipart==0.0.12
pytorch-lightning==1.9.4
pytz==2024.2
PyWavelets==1.7.0
PyYAML==6.0.2
referencing==0.35.1
regex==2024.9.11
requests==2.32.3
resize-right==0.0.2
rich==13.8.1
rpds-py==0.20.0
safetensors==0.4.2
scikit-image==0.21.0
scipy==1.14.1
seaborn==0.13.2
semantic-version==2.10.0
sentencepiece==0.2.0
six==1.16.0
smmap==5.0.1
sniffio==1.3.1
sounddevice==0.5.0
spandrel==0.3.4
spandrel_extra_arches==0.1.1
starlette==0.26.1
sympy==1.13.3
tensorrt==9.0.1.post11.dev4
tensorrt-bindings==9.0.1.post11.dev4
tensorrt-libs==9.0.1.post11.dev4
tifffile==2024.9.20
timm==1.0.9
tokenizers==0.13.3
tomesd==0.1.3
torch==2.4.1+cu124
torchaudio==2.4.1+cu124
torchdiffeq==0.2.3
torchmetrics==1.4.2
torchsde==0.2.6
torchvision==0.19.1+cu124
tqdm==4.66.5
trampoline==0.1.2
transformers==4.30.2
typing_extensions==4.12.2
tzdata==2024.2
ultralytics==8.3.1
ultralytics-thop==2.0.8
urllib3==2.2.3
uvicorn==0.31.0
wcwidth==0.2.13
websockets==11.0.3
xformers @ https://huggingface.co/MonsterMMORPG/Generative-AI/resolve/main/xformers-0.0.28.post1-cp310-cp310-win_amd64.whl#sha256=1b20e753feac2706b16be5cc6631a30a0200f16e5142704cb26cc1454a7968f9
xxhash==3.5.0
yarl==1.13.1
zipp==3.20.2
FurkanGozukara commented 1 month ago

can you please help thank you

@contentis @w-e-w @Milly @shinshin86 @andrewtvuong @eltociear

FurkanGozukara commented 1 month ago

which DLL it needs? i check all files are in folders

Image

Sealih commented 1 week ago

install those Packages.

pip install tensorrt-cu12 tensorrt-cu12_bindings tensorrt-cu12_libs

Image