Skip to content
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

Export to onnx fails for some models with Pytorch 1.12 #472

Closed
ORippler opened this issue Aug 2, 2022 · 0 comments · Fixed by #476
Closed

Export to onnx fails for some models with Pytorch 1.12 #472

ORippler opened this issue Aug 2, 2022 · 0 comments · Fixed by #476

Comments

@ORippler
Copy link
Contributor

ORippler commented Aug 2, 2022

Describe the bug

in Pytorch 1.12, export to onnx fails for all models that rely on kornia.filters.gaussianblur2d.

To Reproduce

Steps to reproduce the behavior:

  1. install PyTorch 1.12
  2. run a model (e.g. padim) with export to onnx enabled

Expected behavior

Export to onnx works also in Pytorch 1.12

Additional context

I believe the error is due to missing shape annotations of torch.nn.functional.interpolate, at least that's where shapes are lost when inspecting via netron.

The problem can be fixed by reimplementing GaussianBlur to not rely on the input shape for computing the kernel (as a drawback num_channels have to be provided explicitly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant