Replies: 2 comments
-
You're running into a squeeze dimension mismatch error during ONNX export for the
This stems from ONNX exporting a What's Going WrongThe ONNX spec requires that
This is in line with known issues in PyTorch’s ONNX exporter around squeezing multiple arbitrary dimensions or squeezing non-singleton dimensions. For example, PyTorch doesn't support tensor.squeeze with multiple dims in one go during ONNX export—this must be done sequentially (GitHub). What You Can TryHere are a few targeted strategies to fix or work around the issue: 1. Refactor the
|
Beta Was this translation helpful? Give feedback.
-
Hi @alishanawer! Thank you for your response. I Opened issue with same content #12208 Now i want to check some ideas that you suggested with replacing squeeze operation. As i see model doesnt have squeeze operation and there is somewhere inside model. and this transformer block uses squeeze operation on output hidden states. So for me to check squeeze operation i should either change installed library or somehow change transformer_block in my model? Did i get it right? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I am trying to convert Transformer2DModel to onnx and cannot solve some problems.
I am trying to export UNet model with next architecture
As as input for my model i use next inputs with shapes:
hidden_states -> (B, 96, Height, Width)
timestep -> (B)
resolution -> (B, 2)
aspect_ratio -> (B, 1)
In python version resolution and aspect ratio are parts of added_cond_kwargs, but since onnx doesn't support dicts i wrote a wrapper that
I export to onnx with torch.onnx.export
But after loading onnx version there is error with squeeze operation
Can you please help with convertation?
Versions:
diffusers==0.27.2
torch==2.2.0+cu118
Beta Was this translation helpful? Give feedback.
All reactions