-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Relay] Support resize in the ONNX conversion #8455
Conversation
schilkunda-amba
commented
Jul 12, 2021
- Added support for resize2d op
- Added unit test
* Added support for resize2d op * Added unit test
* Fixed formatting errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also support resize in other dimensions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @schilkunda-amba! Some small comments
* Fixed issue in resize conversion: round maps to round_preferc_ceil * Updated resize unit test to test for coordinate transform mode and round * Known issue: Does not match for (NN, align_corners) and Cubic
Sure, I will look into it. |
@comaniac @trevor-m I had to add the following: Should I use the discussion forum to debug this? |
@mbrookhart could you help take a look if you got a chance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me. I am curious what the use case for this pass is :)
@mbrookhart Here is the PR for this: https://discuss.tvm.apache.org/t/rfc-relay-to-onnx/6101 The issue I am facing is relay operator resize2d doesn't faithfully convert to onnx operator Resize when method = nearest_neighbor and coordinate_transformation_mode = half_pixel |
Interesting. We run this onnx file in CI and make sure it imports correctly: https://github.com/onnx/onnx/blob/v1.6.0/onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_ceil_half_pixel/model.onnx Maybe you could import it, and then re-export the relay, and compare the protobuf you get with the original? |
Thanks. Let me give it a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. cc @trevor-m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @schilkunda-amba!
* [Relay to Onnx] * Added support for resize2d op * Added unit test * [Relay to Onnx][Resize] * Fixed formatting errors * [Relay to Onnx][Resize] * Fixed issue in resize conversion: round maps to round_preferc_ceil * Updated resize unit test to test for coordinate transform mode and round * Known issue: Does not match for (NN, align_corners) and Cubic * * Fixed formatting errors * * Fixed some more formatting errors
* [Relay to Onnx] * Added support for resize2d op * Added unit test * [Relay to Onnx][Resize] * Fixed formatting errors * [Relay to Onnx][Resize] * Fixed issue in resize conversion: round maps to round_preferc_ceil * Updated resize unit test to test for coordinate transform mode and round * Known issue: Does not match for (NN, align_corners) and Cubic * * Fixed formatting errors * * Fixed some more formatting errors