Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[v1.x] ONNX: fix error handling when op is not registered #20261

Merged
merged 2 commits into from
May 13, 2021

Conversation

Zha0q1
Copy link
Contributor

@Zha0q1 Zha0q1 commented May 12, 2021

fixes #20260

@Zha0q1 Zha0q1 requested a review from szha as a code owner May 12, 2021 18:20
@mxnet-bot
Copy link

Hey @Zha0q1 , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [miscellaneous, clang, edge, unix-cpu, sanity, unix-gpu, website, centos-gpu, centos-cpu, windows-gpu, windows-cpu]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@mseth10 mseth10 added the pr-awaiting-testing PR is reviewed and waiting CI build and test label May 12, 2021
@@ -91,15 +91,22 @@ def convert_layer(node, **kwargs):

op = str(node["op"])
opset_version = kwargs.get("opset_version", onnx_opset_version())
if opset_version < 12:
logging.warning('Your ONNX op set version is %s, ' % str(opset_version) +
'which is lower than then lowest tested op set (12), please consider '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there some variable we can use to print the op set version instead of hard coding "12" in this message? its likely we may forget to update it later...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think unlike cuda where we keep a supported window, the minimum supported version for onnx is fixed at 12 (latest is 14). When new opeset is released we can add support for it without removing the previous opset support

continue
convert_func = MXNetGraph.registry_[op_version][op]
break

if convert_func is None:
raise AttributeError("No conversion function registered for op type %s yet." % op)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment here to explain why this would happen? (ie. is it because the op is not supported or because the installed version of onnx is too old?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added!

@mseth10 mseth10 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels May 12, 2021
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress labels May 12, 2021
Copy link
Contributor

@samskalicky samskalicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the quick fix!

Copy link
Contributor

@josephevans josephevans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

Copy link
Contributor

@waytrue17 waytrue17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mseth10 mseth10 added pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress labels May 12, 2021
@Zha0q1 Zha0q1 merged commit dd1740a into apache:v1.x May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-merge Review and CI is complete. Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants