Open Malathi15 opened 5 years ago
I tried upgrading tensorflow from version 1.12.0 to 1.14.0 and it fixed the issue.
Please reopen if @pbashivan's solution doesn't work.
@pbashivan I got the above mentioned error with Tensorflow 1.12.0. So I upgraded tensorflow to 1.14.0 as mentioned, but now I get a different error.
File "/usr/local/lib/python3.6/site-packages/onnx_tf/backend.py", line 55, in prepare
return cls.onnx_model_to_tensorflow_rep(model, strict)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/backend.py", line 75, in onnx_model_to_tensorflow_rep
return cls._onnx_graph_to_tensorflow_rep(model.graph, opset_import, strict)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/backend.py", line 129, in _onnx_graph_to_tensorflow_rep
onnx_node, tensor_dict, handlers, opset=opset, strict=strict)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/backend.py", line 224, in _onnx_node_to_tensorflow_op
return handler.handle(node, tensor_dict=tensor_dict, strict=strict)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/handlers/handler.py", line 59, in handle
return ver_handle(node, **kwargs)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/handlers/backend/lstm.py", line 212, in version_7
return cls._common(node, **kwargs)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/handlers/backend/lstm.py", line 182, in _common
rnn_kwargs, tf_activations, direction)
File "/usr/local/lib/python3.6/site-packages/onnx_tf/handlers/backend/rnn_mixin.py", line 33, in rnn
cell_kwargs["activation"] = activations[1]
IndexError: list index out of range
Can you please help? Thanks!
@chahna107 Hi, Have you solved the problem,I got the same error?
@M-crazy Unfortunately no. I haven't found any solution to this yet.
@M-crazy @chahna107 Can you provide the onnx file for debugging?
go to this files "onnx-tensorflow\onnx_tf\handlers\backend\is_inf.py" change "@tf_func(tf.math.is_inf)" to " @tf_func(tf.is_inf) "
@chinhuang007 Hi, I got the same error. And this is my onnx file, which has four lstm layers, lstm.onnx.zip
Thanks in advance
%%capture model_onnx = onnx.load('./efficientnet.onnx', load_external_data=False)
tf_rep = prepare(model_onnx)
TypeError Traceback (most recent call last)
%%capture model_onnx = onnx.load('./efficientnet.onnx', load_external_data=False)
tf_rep = prepare(model_onnx)
Export model as .pb file
tf_rep.export_graph('./efficientnet_tf.pb')
Running above commands give me following error
TypeError Traceback (most recent call last) in () 1 model_onnx = onnx.load('./efficientnet.onnx', load_external_data=False) 2 ----> 3 tf_rep = prepare(model_onnx) 4 5 # Export model as .pb file
8 frames /usr/local/lib/python3.6/dist-packages/onnx_tf/backend.py in prepare(cls, model, device, strict, logging_level, **kwargs) 63 common.logger.setLevel(logging_level) 64 ---> 65 return cls.onnx_model_to_tensorflow_rep(model, strict) 66 67 @classmethod
/usr/local/lib/python3.6/dist-packages/onnx_tf/backend.py in onnx_model_to_tensorflow_rep(cls, model, strict) 83 else: 84 opset_import = model.opset_import ---> 85 return cls._onnx_graph_to_tensorflow_rep(model.graph, opset_import, strict) 86 87 @classmethod
/usr/local/lib/python3.6/dist-packages/onnx_tf/backend.py in _onnx_graph_to_tensorflow_rep(cls, graph_def, opset, strict) 141 onnx_node = OnnxNode(node) 142 output_ops = cls._onnx_node_to_tensorflow_op( --> 143 onnx_node, tensor_dict, handlers, opset=opset, strict=strict) 144 curr_node_output_map = dict(zip(onnx_node.outputs, output_ops)) 145 tensor_dict.update(curr_node_output_map)
/usr/local/lib/python3.6/dist-packages/onnx_tf/backend.py in _onnx_node_to_tensorflow_op(cls, node, tensor_dict, handlers, opset, strict) 236 handler = handlers[node.domain].get(node.op_type, None) 237 if handler: --> 238 return handler.handle(node, tensor_dict=tensor_dict, strict=strict) 239 else: 240 exception.OP_UNIMPLEMENTED_EXCEPT(node.op_type)
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/handler.py in handle(cls, node, kwargs) 59 if ver_handle: 60 cls.args_check(node, kwargs) ---> 61 return ver_handle(node, **kwargs) 62 exception.OP_UNIMPLEMENTED_EXCEPT(node.op_type, cls.SINCE_VERSION) 63 return None
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend/pad.py in version_2(cls, node, kwargs) 59 @classmethod 60 def version_2(cls, node, kwargs): ---> 61 return cls._common(node, **kwargs) 62 63 @classmethod
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend/pad.py in _common(cls, node, kwargs) 50 return [ 51 cls.make_tensor_from_onnx_node( ---> 52 node, inputs=[x, paddings, mode, None, constant_values], kwargs) 53 ] 54
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend_handler.py in make_tensor_from_onnx_node(cls, node, tf_func, inputs, attrs, name, c_first_cuda_only, c_last_only, **kwargs) 109 return cls.c_last_only(tf_func, inputs, attrs) 110 --> 111 return cls._run_tf_func(tf_func, inputs, attrs) 112 113 @classmethod
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend_handler.py in _run_tf_func(cls, tf_func, inputs, attrs) 180 attrs = cls._process_attrs(attrs) 181 return tf_func(*inputs, --> 182 **dict([(p, attrs[p]) for p in params if p in attrs]))
TypeError: pad() got multiple values for argument 'name'
can anyone help? Thanks in advance
I got same isue. Have you fixed it yet?
when i ran this command
I got the following error
Can anyone help me how to solve this issue ?
Thanks in advance