参数文件名无效。
import mxnet as mx
import numpy as np
import sys
import os
import argparse
import onnx
print('mxnet version:', mx.__version__)
print('onnx version:', onnx.__version__)
from mxnet.contrib import onnx as onnx_mxnet
from onnx import checker
syms = './mnist-symbol.json'
params = './mnist-0000.params'
input_shape = (1,3,112,112)
onnx_file = './mnist.onnx'
# Invoke export model API. It returns path of the converted onnx model
converted_model_path = onnx_mxnet.export_model(syms, params, [input_shape], np.float32, onnx_file)
最后发现,是参数文件名写错了,"-"和"_"没分清。