lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.8k stars 186 forks source link

[Bug]:AssertionError: No valid accelerator specified for target system #279

Closed Bercraft closed 7 months ago

Bercraft commented 1 year ago

Is there an existing issue for this?

What happened?

Clean install on another venv with the flags --onnx --backend directml cannot convert checkpoint using olive tab.

Steps to reproduce the problem

1 clean install on new venv 2 go to olive tab 3 image size 768 4 Use half floats, VAE Decoder, VAE Encoder unchecked 5 run ----> get error

What should have happened?

Older version converted without problems.

Sysinfo

sysinfo-2023-09-21-08-41(1).txt

What browsers do you use to access the UI ?

Mozilla Firefox

Console logs

venv "olive-venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: 1.6.0
Commit hash: e9afd9aed55da48dfc917753e2daa114a515a85b
WARNING! Because Olive optimization does not support torch 2.0, some packages will be downgraded and it can occur version mismatches between packages. (Strongly recommend to create another virtual environment to run Olive)
Launching Web UI with arguments: --onnx --backend directml --skip-version-check --skip-install
no module 'xformers'. Processing without...
No SDP backend available, likely because you are running in pytorch versions < 2.0. In fact, you are using PyTorch 1.13.1+cpu. You might want to consider upgrading.
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Civitai: API loaded
== WD14 tagger /gpu:0, uname_result(system='Windows', node='DESKTOP-58JI3HI', release='10', version='10.0.19045', machine='AMD64') ==
Checkpoint yiffymix_v34.safetensors [3eefb02c2f] not found; loading fallback stable-diffusion-v1-5
Model stable-diffusion-v1-5 loaded.
Applying attention optimization: sub-quadratic... done.
E:\stable-diffusion-webui-directml\modules\ui.py:929: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row().style(equal_height=False):
E:\stable-diffusion-webui-directml\modules\ui.py:980: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row().style(equal_height=False):
Scanning <DirEntry 'deepdanbooru-v3-20211112-sgd-e28'> as deepdanbooru project
Scanning <DirEntry 'Z3D-E621-Convnext'> as onnx model
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Civitai: Check resources for missing info files
Civitai: Check resources for missing preview images
Startup time: 18.5s (prepare environment: 0.9s, import torch: 3.7s, import gradio: 1.6s, setup paths: 4.7s, initialize shared: 1.5s, other imports: 0.2s, load scripts: 4.9s, initialize extra networks: 0.2s, create ui: 0.8s, gradio launch: 0.3s).
Civitai: Found 47 resources missing info files
Civitai: Found 47 resources missing preview images
Civitai: No preview images found on Civitai
Civitai: No info found on Civitai
Unloaded weights 0.0s.
E:\stable-diffusion-webui-directml\olive-venv\lib\site-packages\transformers\models\clip\feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
  warnings.warn(

Optimizing safety_checker
*** Error completing request
*** Arguments: ('yiffymix_v34.safetensors', '', 'vae', 'stable-diffusion-v1-5', 'stable-diffusion-v1-5', True, True, False, True, False, False, 'euler', False, 768, False, '', '', '') {}
    Traceback (most recent call last):
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 34, in optimize_from_ckpt
        optimize(unoptimized_dir, optimized_dir, pipeline, vae_id, vae_subfolder, safety_checker, text_encoder, text_encoder_2, unet, vae_decoder, vae_encoder, use_fp16, sample_size if hw_synced else sample_size[0], sample_size if hw_synced else sample_size[1], olive_merge_lora, *olive_merge_lora_inputs)
      File "E:\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 98, in optimize
        olive_run(olive_config)
      File "E:\stable-diffusion-webui-directml\olive-venv\lib\site-packages\olive\workflows\run\run.py", line 147, in run
        engine = config.engine.create_engine()
      File "E:\stable-diffusion-webui-directml\olive-venv\lib\site-packages\olive\workflows\run\config.py", line 51, in create_engine
        return Engine(config)
      File "E:\stable-diffusion-webui-directml\olive-venv\lib\site-packages\olive\engine\engine.py", line 131, in __init__
        assert self.accelerator_specs, (
    AssertionError: No valid accelerator specified for target system. Please specify the accelerators in the target system or provide valid execution providers. Given execution providers: ['DmlExecutionProvider']. Current accelerators: ['gpu'].Supported execution providers: {'cpu': ['CPUExecutionProvider', 'OpenVINOExecutionProvider'], 'gpu': ['DmlExecutionProvider', 'CUDAExecutionProvider', 'OpenVINOExecutionProvider', 'TensorrtExecutionProvider', 'CPUExecutionProvider'], 'npu': ['QNNExecutionProvider', 'CPUExecutionProvider']}.

---

Additional information

No response

R-N commented 9 months ago

I had this issue. It was caused by having both onnxruntime and onnxruntime-directml installed. Uninstall the normal one