huggingface / huggingface/diffusers

Failed to import diffusers.pipelines.onnx_utils

Open
#11,199 2 comments 0 reactions 0 assignees View on GitHub
bug stale
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

### Describe the bug

Running error:
```
diffusers\utils\import_utils.py", line 922, in _get_module
raise RuntimeError(
RuntimeError: Failed to import diffusers.pipelines.onnx_utils because of the following error (look up to see its traceback):
DLL load failed while importing onnxruntime_pybind11_state
```

It seems to be a bug , You can manually modify lines 30/31 of the file:onnx_utils.py

lib\site-packages\diffusers\pipelines\onnx_utils.py
```
if is_onnx_available():
import onnxruntime as ort
```

Change it to
```
if False:
import onnxruntime as ort
```

### Reproduction

lib\site-packages\diffusers\pipelines\onnx_utils.py
```
if is_onnx_available():
import onnxruntime as ort
```

Change it to
```
if False:
import onnxruntime as ort
```

### Logs

```shell
Running error:

diffusers\utils\import_utils.py", line 922, in _get_module
raise RuntimeError(
RuntimeError: Failed to import diffusers.pipelines.onnx_utils because of the following error (look up to see its traceback):
DLL load failed while importing onnxruntime_pybind11_state
```

### System Info

diffusers-0.32.2
onnxruntime-gpu=1.21.0

### Who can help?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.