-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: Torch exported Onnx doesn't run after Onnxruntime>=1.17 update - [ShapeInferenceError] #20808
Comments
Here's the DEBUG (0) log from Onnxruntime - I could't find any helpful info:
|
Solved the issue!Cause:Onnx opset version was not compatible with onnxruntime. Note: This is not an issue with ONNXRuntime Fix
|
This issue will be updated in a few months from 31st of May 2024: For general best practice, I recommend explicitly stating the ONNX opset version |
@MengLinMaker Could you list any reference about it? The page
which means the latest onnxruntime would support all opsets >= 7. |
Yep, there's no issues with ONNX Runtime that I could find, except that statement you referenced is inaccurate. A specific opset version was required to solve this issue. Pytorch hard coded the default opset for ONNX conversion. |
Update: |
Describe the issue (Issue solved, see closing comment)
Previously - exporting Torch==2.3 model to Onnx - the model would run on Onnxruntime==1.16
Currently - exporting Torch==2.3 model to Onnx - the model doesn't run on Onnxruntime==1.17 nor Onnxruntime==1.18
The error originates from
[ShapeInferenceError] First input does not have rank 2
However, I could not track down the location of the error using Netron
It's also possible that the problem is caused by "Torch.onnx.export", which can be found in this tutorial
Log truncated - for context
Log last line - I believe this is the cause of the error
To reproduce
I'm using a custom model.
If necessary, I could create a google colab if that helps.
Urgency
I can no longer update Onnxruntime without breaking the application.
Platform
Mac
OS Version
macOS Sonoma 14.5
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.0 and above
ONNX Runtime API
Python
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: