mxnet
mxnet copied to clipboard
KeyError: 'identity1'
the onnx_model_file is the onnx model exported by pytorch (yolo)
But when I import it by mxnet, the error occured as follow:
hope someone can fix the problem, thank you
----> 9 sym, arg, aux = onnx_mxnet.import_model(onnx_model_file)
~/.virtualenvs/mxnet/lib/python3.6/site-packages/mxnet/contrib/onnx/onnx2mx/import_model.py in import_model(model_file)
51 # loads model file and returns ONNX protobuf object
52 model_proto = onnx.load(model_file)
---> 53 sym, arg_params, aux_params = graph.from_onnx(model_proto.graph)
54 return sym, arg_params, aux_params
55
~/.virtualenvs/mxnet/lib/python3.6/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py in from_onnx(self, graph)
113 onnx_attr = self._parse_attr(node.attribute)
114 inputs = [self._nodes[i] for i in node.input]
--> 115 mxnet_sym = self._convert_operator(node_name, op_name, onnx_attr, inputs)
116
117 for k, i in zip(list(node.output), range(len(mxnet_sym.list_outputs()))):
~/.virtualenvs/mxnet/lib/python3.6/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py in _convert_operator(self, node_name, op_name, attrs, inputs)
59 """
60 if op_name in convert_map:
---> 61 op_name, new_attrs, inputs = convert_map[op_name](attrs, inputs, self)
62 else:
63 raise NotImplementedError("Operator {} not implemented.".format(op_name))
~/.virtualenvs/mxnet/lib/python3.6/site-packages/mxnet/contrib/onnx/onnx2mx/_op_translations.py in reshape(attrs, inputs, proto_obj)
416 if len(inputs) == 1:
417 return 'reshape', attrs, inputs[0]
--> 418 reshape_shape = list(proto_obj._params[inputs[1].name].asnumpy())
419 reshape_shape = [int(i) for i in reshape_shape]
420 new_attrs = {'shape': reshape_shape}
KeyError: 'identity1'
my env:
---------Python Info----------
Version : 3.5.2
Compiler : GCC 5.5.0 20171010
Build : ('default', 'Dec 4 2018 14:07:51')
Arch : ('64bit', 'ELF')
------------Pip Info-----------
Version : 18.1
Directory : /home/xyliu/PATH/python-3.5.2/python3/lib/python3.5/site-packages/pip
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
Platform : Linux-4.9.0-4-amd64-x86_64-with-debian-9.3
system : Linux
node : tcs11
release : 4.9.0-4-amd64
version : #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23)
----------Hardware Info----------
machine : x86_64
processor :
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
Stepping: 1
CPU MHz: 1236.401
CPU max MHz: 4000.0000
CPU min MHz: 1200.0000
BogoMIPS: 7200.60
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 15360K
NUMA node0 CPU(s): 0-11
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdseed adx smap xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.2710 sec, LOAD: 1.4593 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.3289 sec, LOAD: 2.2068 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0279 sec, LOAD: 1.3875 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0061 sec, LOAD: 1.2378 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.7703 sec, LOAD: 2.3753 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0061 sec, LOAD: 3.8025 sec.
(mxnet) [xyliu AlphaPose]$ pip show mxnet
Name: mxnet
Version: 1.3.1
Summary: MXNet is an ultra-scalable deep learning framework. This version uses openblas.
Home-page: https://github.com/apache/incubator-mxnet
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: /home/xyliu/.virtualenvs/mxnet/lib/python3.6/site-packages
Requires: graphviz, numpy, requests
Required-by:
Thank you for submitting the issue! I'm labeling it so the MXNet community members can help resolve it.
@mxnet-label-bot add [Python, ONNX]
@lxy5513 this seems similar to the issue https://github.com/apache/incubator-mxnet/issues/13395
+1