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


   ## Description
   I was trying to follow the official documentation: 
https://mxnet.apache.org/versions/1.6/api/python/docs/tutorials/packages/onnx/super_resolution.html
   to import an ONNX model into MXNet but failed.
   
   ### Error Message
   ```
   ValueError                                Traceback (most recent call last)
   <ipython-input-6-d9827b2914f4> in <module>()
   ----> 1 sym, arg, aux = onnx_mxnet.import_model(onnx_model_file)
   
   
/usr/local/lib/python3.7/dist-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     model_opset_version = max([x.version for x in 
model_proto.opset_import])
        60     sym, arg_params, aux_params = graph.from_onnx(model_proto.graph, 
opset_version=model_opset_version)
        61     return sym, arg_params, aux_params
   
   ValueError: max() arg is an empty sequence
   ```
   
   ## To Reproduce
   code to reproduce
   ```
   from PIL import Image
   import numpy as np
   import mxnet as mx
   import mxnet.contrib.onnx as onnx_mxnet
   from mxnet.test_utils import download
   from matplotlib.pyplot import imshow
   img_url = 'https://s3.amazonaws.com/onnx-mxnet/examples/super_res_input.jpg'
   download(img_url, 'super_res_input.jpg')
   model_url = 
'https://s3.amazonaws.com/onnx-mxnet/examples/super_resolution.onnx'
   onnx_model_file = download(model_url, 'super_resolution.onnx')
   sym, arg, aux = onnx_mxnet.import_model(onnx_model_file)
   ```
   You can also access the reproducible script online
   
https://colab.research.google.com/drive/10FuegzQA3iDusWSw4ofCMIi4tOLxg0Dd?usp=sharing
   
   Can you help fix this issue?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to