-
Notifications
You must be signed in to change notification settings - Fork 657
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
[Bug]: torch.onnx.export fails for higher versions of torch #1158
Comments
No clue why mypy doesn't detect this though, and the type-error is caught only at run-time. Might be worth digging deeper into this. |
that's odd, mypy should have caught in the first place. Thanks for spotting this |
Hello! I'm using onnx obtained from anomalib and then reasoning with onnxruntime, the input image shape is [1, 3, 256, 256] but the output is [1, 1, 256, 256], isn't it supposed to be the number of categories? Is there a problem with the .onnx file? @samet-akcay @ORippler @Lothiraldan |
The output is a heatmap, so everything is working as expected |
Describe the bug
Apparently torch performs runtime type-checking with beartype now (not sure since what version exactly). As a consequence, torch.onnx.export errors during model export since we pass a
Path
and notstr | io.BytesIO
types to it.Can be easily fixed by casting to str in torch.onnx.export
Dataset
N/A
Model
N/A
Steps to reproduce the behavior
OS information
OS information:
Expected behavior
Export works
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
No response
Configuration YAML
n/a
Logs
The text was updated successfully, but these errors were encountered: