[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
comaniac
left a comment
There was a problem hiding this comment.
Can we also support resize in other dimensions?
trevor-m
left a comment
There was a problem hiding this comment.
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? |
mbrookhart
left a comment
There was a problem hiding this comment.
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. |
trevor-m
left a comment
There was a problem hiding this comment.
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