Open LeicongLi opened 5 years ago
Hey, this is the MXNet Label Bot. Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it. Here are my recommended label(s): ONNX, Bug
@vandanavk please take a look
@zachgk assign [@oorqueda ]
@oorqueda Please comment if you want me to assign this issue to you (I can only assign it to users who have commented on an issue)
I got the same error "KeyError: 'concat1'", how can you solve it
@szha @Zha0q1 Has this issue been solved?
Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.
For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io
Description
Using mxnet ONNX module to load pre-trained AlexNet model obtained from ONNX official website, but got an error message.
Environment info (Required)
Package used (Python/R/Scala/Julia): (I'm using ...)
For Scala user, please provide:
java -version
)mvn -version
)scala -version
)For R user, please provide R
sessionInfo()
:Build info (Required if built from source)
Compiler (gcc/clang/mingw/visual studio):
MXNet commit hash: (Paste the output of
git rev-parse HEAD
here.)Build config: (Paste the content of config.mk, or the build command.)
Error Message:
(Paste the complete error message, including stack trace.)
Minimum reproducible example
(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)
Steps to reproduce
(Paste the commands you ran that produced the error.)
Link to the model, https://github.com/onnx/models/blob/master/vision/classification/alexnet/README.md
mxnet code used to load
alexnet_path = "/path/to/file" alexnet_tensor = np.random.random([10, 3, 224, 224]) sym, arg_params, aux_params = onnx_mxnet.import_model(alexnet_path) alexnet_tensor = mx.nd.array(alexnet_tensor) mod = mx.mod.Module(symbol=sym, data_names=['actual_input_1'], label_names=None) mod.bind(for_training=False, data_shapes=[('actual_input_1', alexnet_tensor.shape)]) mod.set_params(arg_params=arg_params, aux_params=aux_params, allow_missing=True, allow_extra=True) Batch = namedtuple('Batch', ['data']) mod.forward(Batch([alexnet_tensor])) mx_out = mod.get_outputs()[0][0][0]
Traceback (most recent call last): File "", line 1, in
File "/home/xxx/.local/lib/python3.5/site-packages/mxnet/contrib/onnx/onnx2mx/import_model.py", line 59, in import_model
sym, arg_params, aux_params = graph.from_onnx(model_proto.graph)
File "/home/xxx/.local/lib/python3.5/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py", line 115, in from_onnx
mxnet_sym = self._convert_operator(node_name, op_name, onnx_attr, inputs)
File "/home/xxx/.local/lib/python3.5/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py", line 61, in _convert_operator
op_name, new_attrs, inputs = convert_map[op_name](attrs, inputs, self)
File "/home/xxx/.local/lib/python3.5/site-packages/mxnet/contrib/onnx/onnx2mx/_op_translations.py", line 434, in reshape
reshape_shape = list(proto_obj._params[inputs[1].name].asnumpy())
KeyError: 'concat1'