-
Notifications
You must be signed in to change notification settings - Fork 6.8k
ONNX export: Add Crop, Deconvolution and fix the default stride of Pooling to 1 #12399
Conversation
@ptrendx Did you get a chance to test these operators with ONNX? onnx_backend_test.py |
@ptrendx Thanks for submitting this PR. :) |
pad_dims = list(parse_helper(attrs, "pad", [0, 0])) | ||
num_group = int(attrs.get("num_group", 1)) | ||
dilations = list(parse_helper(attrs, "dilate", [1, 1])) | ||
adj_dims = list(parse_helper(attrs, "adj")) |
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 you please add default value here?
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 you add onnx backend tests here -/~https://github.com/apache/incubator-mxnet/blob/master/tests/python-pytest/onnx/export/onnx_backend_test.py
@ptrendx - ping :-) |
@ptrendx - Thanks for your contributions! Can you please address few review comments and we will be good to go? |
ONNX 1.3 has been merged. Please rebase this PR. Thanks. |
@ptrendx Can you please address review comments and rebase this PR? Thanks. |
Hi, I'm sorry for lack of communication on my part. Unfortunately I got pulled into other high priority work and will be able to revisit this PR afterwards. |
Hi @ptrendx , were you able to get some time on this PR? Do you need any help to continue with this? |
Hi @ptrendx - could you please update on the status for this PR? We are looking forward to merge it into MXNet. Incase if you dont have the bandwidth to address comments on the PR, you can close it at the moment and then re-open it whenever you have the time. |
fd894b3
to
3075806
Compare
Hi, I'm sorry for the long delay in answering the comments. It's rebased onto the latest master. |
"Its definition can change.") | ||
|
||
return [crop_node] | ||
|
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.
could you add a test for crop too? - in mxnet_export_test.py maybe
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.
+1
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.
@vandanavk Could you advise where should I put the test for just export? I made the test but am unsure where should it go after the refactor. My understanding is that test_nodes.py is for things that can be both exported and imported, should I put it in mxnet_export_test.py then?
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.
@ptrendx export tests usually perform an import-export-import on an ONNX model and then compare inference results.
if you are planning to add an ONNX import for crop, then adding the test would be straightforward - just add a test_case in test_node.py.
if you are adding export alone for crop, then in test_node.py, create a new test case list (same format as the existing maybe), add a new function test_export() in class TestNode(unittest.TestCase), export to onnx format. not sure how to test inference in this case though.
@mxnet-label-bot update [pr-awaiting-testing, ONNX] |
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 for addressing the comments. Added minor comments. Can you please take care of these as well? Thanks!
"Its definition can change.") | ||
|
||
return [crop_node] | ||
|
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.
+1
@ptrendx Can you address the review comments so that we can merge this PR? :) |
@ptrendx Can you please rebase this PR? |
ba0b25e
to
abd6951
Compare
@Roshrini could you take a look at this?Thanks |
Hi @ptrendx, if you have test ready for crop, can you please add it? Or maybe create a separate PR for crop operator? Other part of this PR looks good and is ready to be merged. |
…oling to 1 (apache#12399) * Added Deconvolution and Crop to ONNX exporter * Added default for pool_type
…oling to 1 (apache#12399) * Added Deconvolution and Crop to ONNX exporter * Added default for pool_type
…oling to 1 (apache#12399) * Added Deconvolution and Crop to ONNX exporter * Added default for pool_type
…oling to 1 (apache#12399) * Added Deconvolution and Crop to ONNX exporter * Added default for pool_type
Description
Add operators to ONNX exporter:
Fix pooling default stride to 1.
Fixes: No conversion function registered for op type Deconvolution yet #12807
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.