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 2020/03/31 06:12:34 UTC

[GitHub] [incubator-mxnet] becauseofAI opened a new issue #17942: error when slice_axis exporting to onnx

becauseofAI opened a new issue #17942: error when slice_axis exporting to onnx
URL: https://github.com/apache/incubator-mxnet/issues/17942
 
 
   ## Description
   An error occurred when exporting the ```slice_axis()``` operation of mxnet to onnx.
   
   ### Related code
   ```python
   branch1_conv3 = mxnet.symbol.Convolution(data=branch1_relu2,
                                                     kernel=(1, 1),
                                                     stride=(1, 1),
                                                     pad=(0, 0),
                                                     num_filter=2,
                                                     name=prefix_name_branch1)
   predicts = mxnet.symbol.softmax(data=branch1_conv3, axis=1)
   predict = mxnet.symbol.slice_axis(predicts, axis=1, begin=0, end=1)
   ```
   The corresponding json code block is as follows:
   ```json
       {
         "op": "Convolution", 
         "name": "branch1_conv3", 
         "attrs": {
           "kernel": "(1, 1)", 
           "num_filter": "2", 
           "pad": "(0, 0)", 
           "stride": "(1, 1)"
         }, 
         "inputs": [[45, 0, 0], [46, 0, 0], [47, 0, 0]]
       }, 
       {
         "op": "softmax", 
         "name": "softmax0", 
         "attrs": {"axis": "1"}, 
         "inputs": [[48, 0, 0]]
       }, 
       {
         "op": "slice_axis", 
         "name": "slice_axis20", 
         "attrs": {
           "axis": "1", 
           "begin": "0", 
           "end": "1"
         }, 
         "inputs": [[49, 0, 0]]
       }
   ```
   
   ### Error Message
   ```shell
   File "to/path/anaconda3/lib/python3.7/site-packages/mxnet/contrib/onnx/mx2onnx/export_model.py", line 87, in export_model
       verbose=verbose)
     File "to/path/anaconda3/lib/python3.7/site-packages/mxnet/contrib/onnx/mx2onnx/export_onnx.py", line 312, in create_onnx_graph_proto
       checker.check_graph(graph)
     File "to/path/anaconda3/lib/python3.7/site-packages/onnx/checker.py", line 53, in checker
       proto.SerializeToString(), ctx)
   onnx.onnx_cpp2py_export.checker.ValidationError: Node (slice_axis20) has input size 1 not in range [min=3, max=5].
   
   ==> Context: Bad node spec: input: "softmax0" output: "slice_axis20" name: "slice_axis20" op_type: "Slice" attribute { name: "axes" ints: 1 type: INTS } attribute { name: "ends" ints: 1 type: INTS } attribute { name: "starts" ints: 0 type: INTS }
   ```
   
   ### Environment
   mxnet==1.5.0/1.5.1/1.6.0
   onnx>=1.4.0 # the above error occurred
   onnx==1.1.1/1.3.0 # exported successfully
   
   So if I want to use onnx==1.6.0 to export successfully, what can I do for this error?

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] QueensGambit edited a comment on issue #17942: error when slice_axis exporting to onnx

Posted by GitBox <gi...@apache.org>.
QueensGambit edited a comment on issue #17942: error when slice_axis exporting to onnx
URL: https://github.com/apache/incubator-mxnet/issues/17942#issuecomment-609403266
 
 
   Hi @becauseofAI,
   I also experienced issues with the slice operator export and created a PR about this:
   https://github.com/apache/incubator-mxnet/pull/17827
   
   Unfortunately, MXNet lacks support for ONNX versions > 1.3.0 at the moment:
   https://github.com/apache/incubator-mxnet/issues/14589
   
   I think MXNet should aim to support the latest ONNX versions.
   Otherwise it won't benefit from all the bug fixes which were implemented in newer ONNX version.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] QueensGambit edited a comment on issue #17942: error when slice_axis exporting to onnx

Posted by GitBox <gi...@apache.org>.
QueensGambit edited a comment on issue #17942: error when slice_axis exporting to onnx
URL: https://github.com/apache/incubator-mxnet/issues/17942#issuecomment-609403266
 
 
   Hi @becauseofAI,
   I also experienced issues with the slice operator export and created a PR about this:
   https://github.com/apache/incubator-mxnet/pull/17827
   
   Unfortunately, MXNet lacks support for ONNX versions > 1.3.0 at the moment:
   https://github.com/apache/incubator-mxnet/issues/14589
   
   I think MXNet should aim to support the latest ONNX version.
   Otherwise it won't benefit from all the bug fixes which were implemented in newer ONNX versions.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] QueensGambit edited a comment on issue #17942: error when slice_axis exporting to onnx

Posted by GitBox <gi...@apache.org>.
QueensGambit edited a comment on issue #17942: error when slice_axis exporting to onnx
URL: https://github.com/apache/incubator-mxnet/issues/17942#issuecomment-609403266
 
 
   Hi @becauseofAI,
   I also experienced issues with the slice operator export and created a PR about this:
   https://github.com/apache/incubator-mxnet/pull/17827
   
   Unfortunately, MXNet lacks support for ONNX versions > 1.3.0 at the moment:
   https://github.com/apache/incubator-mxnet/issues/14589
   
   I think MXNet should aim to support the latest ONNX versions.
   Otherwise it won't benefit from all the bug fixes which were implemented in newer ONNX versions.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] QueensGambit commented on issue #17942: error when slice_axis exporting to onnx

Posted by GitBox <gi...@apache.org>.
QueensGambit commented on issue #17942: error when slice_axis exporting to onnx
URL: https://github.com/apache/incubator-mxnet/issues/17942#issuecomment-609403266
 
 
   Hi @becauseofAI,
   I also experienced issues with the slice operator export and created a PR about this:
   https://github.com/apache/incubator-mxnet/pull/17827
   
   Unfortunately, MXNet lacks support to ONNX versions > 1.3.0 at the moment:
   https://github.com/apache/incubator-mxnet/issues/14589
   
   I think MXNet should aim to support the latest ONNX versions.
   Otherwise it won't benefit from all the bug fixes which were implemented in newer ONNX version.

----------------------------------------------------------------
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


With regards,
Apache Git Services