Mxnet install issue with onnx

Helo , I build from source with mxnet framework here . It was success testing simeple, tensorrt with resnet18 image classification but have something issue with onnx. I try to export mxnet to onnx model using python3 like below :

import mxnet as mx
import numpy as np
from mxnet.contrib import onnx as onnx_mxnet
import logging
logging.basicConfig(level=logging.INFO)
path='http://data.mxnet.io/models/imagenet/'
mx.test_utils.download(path+'resnet/18-layers/resnet-18-0000.params')
mx.test_utils.download(path+'resnet/18-layers/resnet-18-symbol.json')
mx.test_utils.download(path+'synset.txt')
sym = './resnet-18-symbol.json'
params = './resnet-18-0000.params'
input_shape = (1,3,224,224)
onnx_file = './mxnet_exported_resnet50.onnx'
converted_model_path = onnx_mxnet.export_model(sym, params, 
[input_shape], np.float32, onnx_file)

And then I got issue like this :

 tor_database.cc:118] File already exists in database: onnx/onnx-ml.proto
 [libprotobuf FATAL google/protobuf/descriptor.cc:1367] CHECK failed: 
 GeneratedDatabase()->Add(encoded_file_descriptor, size): 
 terminate called after throwing an instance of 
 'google::protobuf::FatalException'
  what():  CHECK failed: GeneratedDatabase()- 
 >Add(encoded_file_descriptor, size): 
 Aborted (core dumped)

Thank you.

Hi,

The script is built with MXNet v1.8.x which integrates ONNX v1.6.0.
So please make sure the same ONNX version is installed in your environment.

$ sudo pip3 install onnx==1.6.0

Thanks.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.