Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

KeyError: 'identity1' #54

Open
lxy5513 opened this issue Jan 4, 2019 · 1 comment
Open

KeyError: 'identity1' #54

lxy5513 opened this issue Jan 4, 2019 · 1 comment

Comments

@lxy5513
Copy link

lxy5513 commented Jan 4, 2019

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'
@anirudhacharya
Copy link
Member

this module has been moved into mxnet repo. Can you please raise this issue here - https://github.com/apache/incubator-mxnet/issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants