You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/05/12 18:20:29 UTC

[GitHub] [incubator-mxnet] Zha0q1 opened a new pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Zha0q1 opened a new pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261


   fixes https://github.com/apache/incubator-mxnet/issues/20260


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 merged pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Posted by GitBox <gi...@apache.org>.
Zha0q1 merged pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Posted by GitBox <gi...@apache.org>.
Zha0q1 commented on a change in pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261#discussion_r631304278



##########
File path: python/mxnet/onnx/mx2onnx/_export_onnx.py
##########
@@ -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 '

Review comment:
       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




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Posted by GitBox <gi...@apache.org>.
Zha0q1 commented on a change in pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261#discussion_r631306699



##########
File path: python/mxnet/onnx/mx2onnx/_export_onnx.py
##########
@@ -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 '
+                            'updating ONNX')
+            opset_version = 12
         # fallback to older opset versions if op is not registered in current version
+        convert_func = None
         for op_version in range(opset_version, 11, -1):
             if op_version not in MXNetGraph.registry_ or op not in MXNetGraph.registry_[op_version]:
-                if opset_version == 12:
-                    raise AttributeError("No conversion function registered for op type %s yet." % op)
                 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)

Review comment:
       added!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Posted by GitBox <gi...@apache.org>.
samskalicky commented on a change in pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261#discussion_r631300701



##########
File path: python/mxnet/onnx/mx2onnx/_export_onnx.py
##########
@@ -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 '
+                            'updating ONNX')
+            opset_version = 12
         # fallback to older opset versions if op is not registered in current version
+        convert_func = None
         for op_version in range(opset_version, 11, -1):
             if op_version not in MXNetGraph.registry_ or op not in MXNetGraph.registry_[op_version]:
-                if opset_version == 12:
-                    raise AttributeError("No conversion function registered for op type %s yet." % op)
                 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)

Review comment:
       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?)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Posted by GitBox <gi...@apache.org>.
samskalicky commented on a change in pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261#discussion_r631299671



##########
File path: python/mxnet/onnx/mx2onnx/_export_onnx.py
##########
@@ -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 '

Review comment:
       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...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20261: [v1.x] ONNX: fix error handling when op is not registered

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20261:
URL: https://github.com/apache/incubator-mxnet/pull/20261#issuecomment-839995202


   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. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org