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

[GitHub] [incubator-mxnet] flexwend opened a new issue #19803: Failed to load mobilenetv2-7 of ONNX model zoo with MXNet

flexwend opened a new issue #19803:
URL: https://github.com/apache/incubator-mxnet/issues/19803


   ## Description
   While trying to load the mobilenetv2-7 (onnx 1.2.1, opset 7, [Mobilenet in ONNX model zoo](https://github.com/onnx/models/tree/master/vision/classification/mobilenet)) with mxnet the following error occures. I am using:
   - onnx 1.7.0
   - mxnet 1.7.0
   - python 3.8.5
   
   Other examples work fine like:
   - googlenet-3.onnx
   - googlenet-9.onnx
   - resnet18-v2-7.onnx
   - tinyyolov2-8.onnx
   - vgg16-7.onnx
   
   Some are failing too with similar errors:
   - mtiny-yolov3-11.onnx
   - yolov2-coco-9.onnx
   - yolov3-10.onnx
   - yolov4.onnx
   
   When will the changes to [contrib/onnx](https://github.com/apache/incubator-mxnet/tree/master/python/mxnet/contrib/onnx) be introduce into a stable version?
   
   ### Error Message
   ```
   ---------------------------------------------------------------------------
   KeyError                                  Traceback (most recent call last)
   <ipython-input-2-748095751592> in <module>
         8 print("checked")
         9 
   ---> 10 sym, arg, aux = onnx_mxnet.import_model(model_path)
   
   C:\tools\Anaconda3\envs\mxnet\lib\site-packages\mxnet\contrib\onnx\onnx2mx\import_model.py in import_model(model_file)
        57     # loads model file and returns ONNX protobuf object
        58     model_proto = onnx.load_model(model_file)
   ---> 59     sym, arg_params, aux_params = graph.from_onnx(model_proto.graph)
        60     return sym, arg_params, aux_params
        61 
   
   C:\tools\Anaconda3\envs\mxnet\lib\site-packages\mxnet\contrib\onnx\onnx2mx\import_onnx.py in from_onnx(self, graph)
       112             node_name = node_name if node_name else None
       113             onnx_attr = self._parse_attr(node.attribute)
   --> 114             inputs = [self._nodes[i] for i in node.input]
       115             mxnet_sym = self._convert_operator(node_name, op_name, onnx_attr, inputs)
       116 
   
   C:\tools\Anaconda3\envs\mxnet\lib\site-packages\mxnet\contrib\onnx\onnx2mx\import_onnx.py in <listcomp>(.0)
       112             node_name = node_name if node_name else None
       113             onnx_attr = self._parse_attr(node.attribute)
   --> 114             inputs = [self._nodes[i] for i in node.input]
       115             mxnet_sym = self._convert_operator(node_name, op_name, onnx_attr, inputs)
       116 
   
   KeyError: '475'
   ```
   
   ## To Reproduce
   ```
   import onnx
   import mxnet.contrib.onnx as onnx_mxnet
   
   model_path = 'mobilenetv2-7.onnx'
   
   onnx_model = onnx.load(model_path)
   onnx.checker.check_model(onnx_model)
   print("checked")
   
   sym, arg, aux = onnx_mxnet.import_model(model_path)
   ```
   
   ## What have you tried to solve it?
   
   1. other onnx version (1.8, 1.6, problems installing older versions)
   
   ## Environment
   
   ***We recommend using our script for collecting the diagnostic information with the following command***
   `curl --retry 10 -s https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py | python3`
   
   <details>
   <summary>Environment Information</summary>
   
   ```
   Name
   Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
   
   ----------Python Info----------
   Version      : 3.8.2
   Compiler     : MSC v.1916 64 bit (AMD64)
   Build        : ('tags/v3.8.2:7b3ab59', 'Feb 25 2020 23:03:10')
   Arch         : ('64bit', 'WindowsPE')
   ------------Pip Info-----------
   Version      : 20.3.3
   Directory    : C:\Python38\lib\site-packages\pip
   ----------MXNet Info-----------
   No MXNet installed.
   ----------System Info----------
   Platform     : Windows-10-10.0.18362-SP0
   system       : Windows
   node         : LAPTOP-0CO234CL
   release      : 10
   version      : 10.0.18362
   ----------Hardware Info----------
   machine      : AMD64
   processor    : Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0221 sec, LOAD: 0.4165 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0469 sec, LOAD: 0.3008 sec.
   Error open Gluon Tutorial(cn): https://zh.gluon.ai, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)>, DNS finished in 0.05338788032531738 sec.
   Error open FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>, DNS finished in 0.020638704299926758 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0156 sec, LOAD: 0.4383 sec.
   Error open Conda: https://repo.continuum.io/pkgs/free/, HTTP Error 403: Forbidden, DNS finished in 0.06250691413879395 sec.
   ----------Environment----------
   
   ```
   
   </details>
   


----------------------------------------------------------------
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] github-actions[bot] commented on issue #19803: Failed to load mobilenetv2-7 of ONNX model zoo with MXNet

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #19803:
URL: https://github.com/apache/incubator-mxnet/issues/19803#issuecomment-769780767


   Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue.
   Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly.
   If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on [contributing to MXNet](https://mxnet.apache.org/community/contribute) and our [development guides wiki](https://cwiki.apache.org/confluence/display/MXNET/Developments).


----------------------------------------------------------------
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] AK391 commented on issue #19803: Failed to load mobilenetv2-7 of ONNX model zoo with MXNet

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


   @flexwend I got a similar issue, were you able to resolve this?


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

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

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] flexwend commented on issue #19803: Failed to load mobilenetv2-7 of ONNX model zoo with MXNet

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


   Thanks for the reply @Zha0q1. The use case is to load and fine-tune an onnx model followed by inference, similar to this [tutorial](https://mxnet.apache.org/versions/1.7.0/api/python/docs/tutorials/packages/onnx/fine_tuning_gluon.html)


----------------------------------------------------------------
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] Zha0q1 commented on issue #19803: Failed to load mobilenetv2-7 of ONNX model zoo with MXNet

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


   Hi @flexwend, yeah the onnx support has been a little behind but we are actively working on improving it. We are trying to prioritize mx2onnx at the moment. We do have many models trained in mxnet that you can export to onnx fine (https://cv.gluon.ai/model_zoo/index.html). May I ask your use case after import? Are you trying to train or inference? Thanks!


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