“3be59e4e24ef1f478685da85d1e76b17485295c2”上不存在“tests/script/general/parser”
提交 2f949efb 编写于 作者: B Bin Li 提交者: 叶剑武

Fix multiple models in one yml

上级 da75792c
...@@ -310,6 +310,8 @@ class TensorflowConverter(base_converter.ConverterInterface): ...@@ -310,6 +310,8 @@ class TensorflowConverter(base_converter.ConverterInterface):
self.add_shape_info(transformed_graph_def) self.add_shape_info(transformed_graph_def)
# reset default graph to clear earlier import
tf.reset_default_graph()
with tf.Session() as session: with tf.Session() as session:
with session.graph.as_default() as graph: with session.graph.as_default() as graph:
tf.import_graph_def(transformed_graph_def, name='') tf.import_graph_def(transformed_graph_def, name='')
...@@ -319,7 +321,6 @@ class TensorflowConverter(base_converter.ConverterInterface): ...@@ -319,7 +321,6 @@ class TensorflowConverter(base_converter.ConverterInterface):
# we have polluted graph with 'shape' ops, so reset it and reload it # we have polluted graph with 'shape' ops, so reset it and reload it
# again # again
tf.reset_default_graph() tf.reset_default_graph()
with tf.Session() as session: with tf.Session() as session:
with session.graph.as_default() as graph: with session.graph.as_default() as graph:
tf.import_graph_def(transformed_graph_def, name='') tf.import_graph_def(transformed_graph_def, name='')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册