mxnet-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-mxnet] Zha0q1 edited a comment on issue #19808: onnx model
Date Mon, 01 Feb 2021 08:02:40 GMT

Zha0q1 edited a comment on issue #19808:

   Actually I just tried exporting on the latest v1.x branch and was able to do it with all
3 models.
   This is the script I used:
   from gluoncv import model_zoo, data, utils
   from matplotlib import pyplot as plt
   import numpy as np
   import mxnet as mx
   import gluonnlp as nlp
   from mxnet.contrib import onnx as onnx_mxnet
   import onnx
   model_name = 'resnest50'
   net = model_zoo.get_model(model_name, pretrained=True)
   im_fname ='' +
   x, img = data.transforms.presets.ssd.load_test(im_fname, short=512)
   print('Shape of pre-processed image:', x.shape)
   pred = net(x)
   input_shapes = [(1,3,512,512)]
   sym_file = model_name + '-symbol.json'
   params_file = model_name + '-0000.params'
   onnx_file = model_name + '.onnx'
   converted_model_path = onnx_mxnet.export_model(sym_file, params_file, input_shapes,
                                                  np.float32, onnx_file, verbose=True)
   @alicera would you give it a try? Also can you share your script? 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:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message