[Bug] [Relay] [ONNX] Incorrect shape inference of Squeeze
in DynamicToStatic
#17050
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
Description
This torch model has only two ops:
ReflectionPad3d
andsqueeze
Firstly, I try to export the
![model onnx](https://private-user-images.githubusercontent.com/100203773/335452789-ad6dd940-1db0-429a-93f9-75ff36077af5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjA2MjEsIm5iZiI6MTczOTM2MDMyMSwicGF0aCI6Ii8xMDAyMDM3NzMvMzM1NDUyNzg5LWFkNmRkOTQwLTFkYjAtNDI5YS05M2Y5LTc1ZmYzNjA3N2FmNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQxMTM4NDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZTk2NTI2YTdkMjc1NzI5NDM2YzVjYzE5ZmM0MmE0ZDgyNzhjYjdiNTYwMjczNTc5YjFlZmIxYmRhOTgzODMzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.WFMrMG13o67A_KoYxi4FyjNmrH3Msm1tLVxFEM3JOwA)
torch model
toonnx model
.Then I get the below.
Onnx does its unique operation on the model.
We can find that this is a dynamic graph which contains
if branch
structure because of the squeeze operator.ONNX thinks this model is valid.
However, When I used relay to convert the model, I met
shape mismatch
error. The correct shape should be Tensor[(13, 1, 1, 1), float32] but TVM got Tensor[(13, 13, 1, 1), float32].(I think maybe) TVM has some bugs in the DynamicToStatic :(
Code
Error Log
click to see the error log
Environment
TVM d1ac1c0
ubuntu 20
cc @KJlaccHoeUM9l @shingjan
The text was updated successfully, but these errors were encountered: