提交 574aae73 编写于 作者: 李寅

Ignore transform graph if error

上级 1a35a1a0
...@@ -271,11 +271,15 @@ class TensorflowConverter(base_converter.ConverterInterface): ...@@ -271,11 +271,15 @@ class TensorflowConverter(base_converter.ConverterInterface):
print("Run transform_graph: %s" % TFTransformGraphOptions[ print("Run transform_graph: %s" % TFTransformGraphOptions[
option.device]) option.device])
transformed_graph_def = TransformGraph(tf_graph_def, try:
option.input_nodes.keys(), transformed_graph_def = TransformGraph(tf_graph_def,
option.output_nodes.keys(), option.input_nodes.keys(),
TFTransformGraphOptions[ option.output_nodes.keys(),
option.device]) TFTransformGraphOptions[
option.device])
except Exception as ex:
print("Failed to transform graph using tf tool: %s" % ex)
transformed_graph_def = tf_graph_def
with tf.Session() as session: with tf.Session() as session:
with session.graph.as_default() as graph: with session.graph.as_default() as graph:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册