Skip to content

Failed to import diffusers.pipelines.onnx_utils #11199

@juntaosun

Description

@juntaosun

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions