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/16 17:34:10 UTC

[GitHub] [incubator-mxnet] thomas-beznik opened a new issue #17848: Import ONNX model from Pytorch to MXNet

thomas-beznik opened a new issue #17848: Import ONNX model from Pytorch to MXNet
URL: https://github.com/apache/incubator-mxnet/issues/17848
 
 
   ## Description
   Hello,
   
   I am trying to convert an ONNX model coming from a PyTorch model to an MXNet model. The PyTorch model is an FPN that comes from this repository https://github.com/qubvel/segmentation_models.pytorch.
   I am running into the following error when using the method mxnet.contrib.onnx.onnx2mx.import_model
   
   ### Error Message
   
   Traceback (most recent call last):
     File "C:/Users/thoma/Documents/relu/AI_API/API/Detectors/Slice2DDetectorONNX.py", line 96, in <module>
       sym, arg_params, aux_params = import_model(model_path)
     File "C:\Users\thoma\Documents\relu\AI_API\env\lib\site-packages\mxnet\contrib\onnx\onnx2mx\import_model.py", line 59, in import_model
       sym, arg_params, aux_params = graph.from_onnx(model_proto.graph)
     File "C:\Users\thoma\Documents\relu\AI_API\env\lib\site-packages\mxnet\contrib\onnx\onnx2mx\import_onnx.py", line 115, in from_onnx
       inputs = [self._nodes[i] for i in node.input]
     File "C:\Users\thoma\Documents\relu\AI_API\env\lib\site-packages\mxnet\contrib\onnx\onnx2mx\import_onnx.py", line 115, in <listcomp>
       inputs = [self._nodes[i] for i in node.input]
   KeyError: 'components.0.net.net.encoders.0.basic_module.SingleConv1.conv.weight'
   
   I saw similar issues (such as https://github.com/apache/incubator-mxnet/issues/13395), which say that the problem comes from the fact that Dynamic Shape isn't implemented. But in my case, I am not using a dynamic shape; all my inputs are resized to a fixed shape before being fed to the model. Is there thus a way to easily change my architecture such that it uses this fixed shape and enables me to load my model in MXNet? 
   
   I can give more information if needed, any direction to solve this would be greatly appreciated!
   
   ## To Reproduce
   - python 3.6
   - onnx 1.6.0
   - mxnet 1.5.0
   

----------------------------------------------------------------
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] woolpeeker commented on issue #17848: Import ONNX model from Pytorch to MXNet

Posted by GitBox <gi...@apache.org>.
woolpeeker commented on issue #17848:
URL: https://github.com/apache/incubator-mxnet/issues/17848#issuecomment-696682517


   I meet the same problem.  Has it solved?


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] woolpeeker commented on issue #17848: Import ONNX model from Pytorch to MXNet

Posted by GitBox <gi...@apache.org>.
woolpeeker commented on issue #17848:
URL: https://github.com/apache/incubator-mxnet/issues/17848#issuecomment-696682517


   I meet the same problem.  Has it solved?


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org