-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[v1.x] Update onnx support to work with onnx 1.7.0 with most CV models #19017
Conversation
* fix pooling_convention warning * fix pooling_convention warning * fix lint Co-authored-by: JackieWu <[email protected]>
Hey @josephevans , Thanks for submitting the PR
CI supported jobs: [centos-cpu, windows-cpu, edge, miscellaneous, unix-cpu, sanity, website, unix-gpu, centos-gpu, clang, windows-gpu] Note: |
…rsion supported by onnx. Pass this parameter to each graph layer when exporting.
…which onnx opset version they want to use when exporting, defaults to latest version supported by onnx.
…n time, we know what opset version to use.
…bj, which reflects what opset version the onnx model uses.
…et versions. Check opset version instead of ONNX version for Pooling operator.
…rom gluon model zoo.
…8675) Signed-off-by: Serge Panev <[email protected]>
…ions - this gets all ONNX unit tests to pass with onnx 1.7.
…ormal unittests pipelines.
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 update documentation as relevant
https://cwiki.apache.org/confluence/display/MXNET/ONNX
https://mxnet.apache.org/api/python/docs/tutorials/deploy/export/onnx.html#Prerequisites
@Kh4L for review please. Thank you. |
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, thanks for backporting these PRs!
… to install onnx and onnxruntime in the CentOS containers.
@vandanavk Refactored based on your review, could you please approve? thanks, |
@josephevans what's the status of adding the PR to the master branch? |
Forward port of apache#19017 Co-authored-by: Joe Evans <[email protected]>
Thanks for bringing it up. It should be on 1.X and Joe had plans for the same. @josephevans |
Forward port of apache#19017 Co-authored-by: Joe Evans <[email protected]>
Forward port of apache#19017 Co-authored-by: Joe Evans <[email protected]>
Description
This PR improves MXNet support for onnx import and export for newer onnx versions (including the latest, 1.7.0).
The goal of this PR is to allow exporting of the most common CV models used and verify inference with the latest onnxruntime (1.4.0).
With newer onnx opset versions, the attributes for some operators have been changed to inputs, so most of the work in the two _op_translations.py files relates to converting between attributes and inputs. Updated operator translations between MXNet and onnx as follows:
Export operators:
Import operators:
This PR also changes the import and export code to pass an “opset_version” variable which defaults to the latest version supported by the installed onnx module. This variable is used to determine what format to use for onnx conversions.
This PR also cherry-picks the following PRs from the master branch:
This PR also updates the CI environments to install the latest version of onnx (1.7.0) and onnxruntime (1.4.0) for testing model export from mxnet and inference using onnxruntime.
All onnx unit tests are passing. An additional onnx test has been added in tests/python-pytest/onnx/test_onnxruntime.py which tests the following models (from gluoncv model zoo) for export and inference in onnxruntime:
There are still some operators that need to be updated to support the latest opset versions.