keras-onnx icon indicating copy to clipboard operation
keras-onnx copied to clipboard

Can't convert LSTM

Open vitillo opened this issue 5 years ago • 2 comments
trafficstars

When trying to a LSTM network I am getting the following error with keras2onnx 1.6.5:


AssertionError Traceback (most recent call last) in ----> 1 onnx_model = keras2onnx.convert_keras(model, model.name)

~\Anaconda3\lib\site-packages\keras2onnx\main.py in convert_keras(model, name, doc_string, target_opset, channel_first_inputs, debug_mode, custom_op_conversions) 58 custom_op_dict=custom_op_conversions) 59 topology.debug_mode = debug_mode ---> 60 parse_graph(topology, tf_graph, target_opset, output_names, output_dict) 61 topology.compile() 62

~\Anaconda3\lib\site-packages\keras2onnx\parser.py in parse_graph(topo, graph, target_opset, output_names, keras_node_dict) 791 return _parse_graph_core_v2( 792 graph, keras_node_dict, topo, top_level, output_names --> 793 ) if is_tf2 and is_tf_keras else _parse_graph_core( 794 graph, keras_node_dict, topo, top_level, output_names)

~\Anaconda3\lib\site-packages\keras2onnx\parser.py in _parse_graph_core_v2(graph, keras_node_dict, topology, top_scope, output_names) 712 on_parsing_keras_layer_v2(graph, layer_info, varset) 713 else: --> 714 on_parsing_tf_nodes(layer_info.nodelist, varset) 715 716 for nd in input_nodes:

~\Anaconda3\lib\site-packages\keras2onnx\parser.py in on_parsing_tf_nodes(nodelist, varset) 307 for node in nodelist: 308 cvt = get_converter(node_.type) --> 309 assert cvt is not None, "Cannot find the tf.op({}) converter for the node {}.".format(node_.type, node_.name) 310 k2o_logger().debug("Processing a tf node - %s" % node_.name) 311 operator = varset.declare_local_operator(node_.type, raw_model=node_, op_name=node_.name)

AssertionError: Cannot find the tf.op(Placeholder) converter for the node lstm_2/StatefulPartitionedCall/args_5.

vitillo avatar Jan 30 '20 06:01 vitillo

is this LSTM including a custom cell? Can you share us some details about the model?

wenbingl avatar Feb 12 '20 18:02 wenbingl

please close the issue if no further assistance is needed; otherwise, please share more info as requested.

faxu avatar Oct 12 '20 20:10 faxu