models icon indicating copy to clipboard operation
models copied to clipboard

KeyError: '475' mobilenet imagenet inference notebook

Open AK391 opened this issue 2 years ago • 2 comments

Traceback (most recent call last): File "app.py", line 20, in sym, arg_params, aux_params = import_model('mobilenetv2-7.onnx') File "/home/user/.local/lib/python3.8/site-packages/mxnet/contrib/onnx/onnx2mx/import_model.py", line 60, in import_model sym, arg_params, aux_params = graph.from_onnx(model_proto.graph, opset_version=model_opset_version) File "/home/user/.local/lib/python3.8/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py", line 116, in from_onnx inputs = [self._nodes[i] for i in node.input] File "/home/user/.local/lib/python3.8/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py", line 116, in inputs = [self._nodes[i] for i in node.input] KeyError: '475'

AK391 avatar Mar 10 '22 03:03 AK391

Hi @AK391, Thank you for catching it. I guess for the original version of the model, mobilenetv2-7.onnx might work. Could you please try this old model instead? There were several updates for mobilenetv2-7.onnx (for instance, https://github.com/onnx/models/pull/410) and something might not be supported by the mxnet-onnx yet. As you can see from here, mxnet-onnx does not support it even for now. The notebook in onnx/models needs to be updated as well to prevent future confusion.

jcwchen avatar Mar 14 '22 21:03 jcwchen

Thank you, @jcwchen . I encountered the same issue. The old model you specified worked!

zzxiang avatar Jul 09 '22 19:07 zzxiang