Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6405 Discussions

RuntimeError: expand: the requested shape has too few dimensions!

Krebzonide
Beginner
971 Views

I got stable diffusion working on my A770 and I want to upgrade to sdxl. I downloaded an sdxl model and loaded it, and it ran but had weird colors. I thought I just need a vae. I download the vae, change the vae setting, and when I hit generate I get the error:

BackendCompilerFailed: backend='openvino_fx' raised: RuntimeError: expand: the requested shape has too few dimensions! While executing %expand : [num_users=1] = call_method[target=expand](args = (%to, 2), kwargs = {}) Original traceback: File "C:\Users\corey\AppData\Local\Programs\Python\Python310\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\unet_2d_condition.py", line 923, in forward timesteps = timesteps.expand(sample.shape[0]) Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information You can suppress this exception and fall back to eager by setting: import torch._dynamo torch._dynamo.config.suppress_errors = True

I went back and removed the vae from the folder and changed the settings back to what they were, and I'm still getting the same error. I can't even get the weird color image I had before. When I originally clicked "apply settings" after adding the vae, it said about 30 things had changed. When I clicked that button to undo the vae, it said only one setting had changed. My best guess is one of those random changes is causing the error, but I have no idea which one it could be out of the hundreds of settings.

I deleted my config.json file and restarted a1111 to reset my settings. I get the exact same error from above. I went back and hit apply settings again just to get the list in case this helps you. I think it was 29 changes the first time but I didn't modify the vae settings again:

27 settings changed: ldsr_steps, ldsr_cached, SCUNET_tile, SCUNET_tile_overlap, SWIN_tile, SWIN_tile_overlap, lora_functional, sd_lora, lora_preferred_name, lora_add_hashes_to_infotext, lora_show_all, lora_hide_unknown_for_versions, lora_in_memory_limit, extra_options_txt2img, extra_options_img2img, extra_options_cols, extra_options_accordion, canvas_hotkey_zoom, canvas_hotkey_adjust, canvas_hotkey_move, canvas_hotkey_fullscreen, canvas_hotkey_reset, canvas_hotkey_overlap, canvas_show_tooltip, canvas_auto_expand, canvas_blur_prompt, canvas_disabled_functions.

Of course I would prefer not to reinstall everything. If I did that and got back to the same point, how would I even use the vae without running into the same error again? Also, I notice I can run the sdxl model without openvino on the cpu, and it runs fine with normal colors even without the sdxl vae.
 
 
0 Kudos
7 Replies
Megat_Intel
Moderator
944 Views

Hi Krebzonide,

Thank you for reaching out to us.

 

For your information, I downloaded the stable-diffusion-xl-base-1.0 model and was able to generate an image on the first try. However, I received the same error as yours on my subsequent tries. webui-error .png

cmd-error .png

 

On the other hand, generating images without selecting the "Accelerate with OpenVINO" script works just fine as you mentioned.

 

I tried downloading another model (anything-v3.0) and was able to generate images with the OpenVINO™ script selected multiple times without encountering any error messages. anything-v3 .png

 

The error might be due to model incompatibility with OpenVINO™. Can you confirm with us the exact sdxl model and the vae model link that you used for us to investigate further?

 

 

Regards,

Megat

 

0 Kudos
Krebzonide
Beginner
913 Views
The sdxl model I was trying to use is Juggernaut XL v6 (https://civitai.com/models/133005?modelVersionId=198530) and the VAE was this one (https://huggingface.co/madebyollin/sdxl-vae-fp16-fix). Could the issue be related to using fp16 rather than fp32? I’m traveling so I cannot test on my end until Wednesday night at the earliest.
0 Kudos
Megat_Intel
Moderator
859 Views

Hi Krebzonide,

Thank you for the information provided.

 

We have informed the relevant team regarding your issue for further investigation and we will get back to you once we receive any update.

 

 

Regards,

Megat


0 Kudos
mcavus
Employee
738 Views

@Krebzonide, I was not able to reproduce the same issue on my side. Could you please share more details about your system configuration?

0 Kudos
Krebzonide
Beginner
719 Views
Sure. Here is a list of what I can remember right now. If you need more specific details then I need a more specific question.

OS: windows 10 home, up to date
GPU: Arc A770 Sparkle
Cpu: Intel 12600KF
Ram: 32GB DDR4 3000 MT/S CL15
Main C drive: 1tb M.2 (everything related to stable diffusion should be on this C drive)
Second drive: 4tb HDD
PSU: 750W 80+ gold
Motherboard: B660M
Browser: Firefox

I’ve also had a lot of trouble with python stuff in general so there might be remnants of other module versions or python itself. Due to this issue I haven’t touched python in 3 weeks so I forget how clean I was with uninstalling everything before reinstalling it.
0 Kudos
Krebzonide
Beginner
509 Views

After waiting so long I decided to just go with a different program. I installed Fooocus with ipex and it runs sdxl fine so I will use that for now.

0 Kudos
Megat_Intel
Moderator
469 Views

Hi Krebzonide,

We are so sorry that you had to go through this. We apologize for the inconvenience caused.

 

For your information, while we are trying to replicate and analyze the issue further, we receive other related errors as well which the Engineering team is working on fixing. We will continue to improve and fix the issues in the upcoming release.

 

Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.

 

 

Regards,

Megat

 

0 Kudos
Reply