-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[v1.x] ONNX: fix error handling when op is not registered #20261
Conversation
Hey @Zha0q1 , Thanks for submitting the PR
CI supported jobs: [miscellaneous, clang, edge, unix-cpu, sanity, unix-gpu, website, centos-gpu, centos-cpu, windows-gpu, windows-cpu] Note: |
@@ -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 ' |
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.
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...
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.
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) |
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 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?)
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.
added!
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 the quick fix!
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 the fix!
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!
fixes #20260