harishanand95 / diffusers

AMD ONNX port of 🤗 Diffusers: State-of-the-art diffusion models
Apache License 2.0
58 stars 16 forks source link

onnx/unet.onnx failed. File doesn't exist??? #13

Open Pichuale opened 2 years ago

Pichuale commented 2 years ago

Describe the bug

Traceback (most recent call last):
  File "c:\Users\(Myusername)\OneDrive\Desktop\STable D\diffusers\examples\inference\dml_onnx.py", line 210, in <module>
    image = pipe(prompt, height=512, width=512, num_inference_steps=50, guidance_scale=7.5, eta=0.0, execution_provider="DmlExecutionProvider")["sample"][0]
  File "C:\Users\(Myusername)\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "c:\Users\(Myusername)\OneDrive\Desktop\STable D\diffusers\examples\inference\dml_onnx.py", line 73, in __call__
    unet_sess = ort.InferenceSession("onnx/unet.onnx", so, providers=[ep])
  File "C:\Users\(Myusername)\AppData\Local\Programs\Python\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 347, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "C:\Users\(Myusername)\AppData\Local\Programs\Python\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 384, in _create_inference_session        
    sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from onnx/unet.onnx failed:Load model onnx/unet.onnx failed. File doesn't exist

The first two prompts I made ran fine but then after that it kept giving me this error. I have unet.onnx downloaded, I tried uninstalling everything and downloading again, nothing worked. Somebody please help

Reproduction

No response

Logs

No response

System Info

Python Version: 3.10.5
Diffusers Version: latest? I'm not sure, I just ran git clone.
GPU: RX 5600XT
KarolJanaszek commented 1 year ago

After 1st instalation I'v got #14 error and it makes me not to create onnx folder, so after reapir #14 I'v needed to run one more time python ./save_onnx.py and folder onnx appears, so problem was solved.