Commit 3d9b1739 by Yong Wu Committed by Yao Wang

[Bugfix][TF] reset graph after getting tag of savedmodel (#4055)

@zhiics @icemelon9
parent 92ffa062
......@@ -79,15 +79,16 @@ class TFParser(object):
"InputConfiguration: Unable to import tensorflow which is "
"required to restore from saved model.")
tags = self._get_tag_set()
output_names = set()
with tf.Session() as sess:
meta_graph_def = tf.saved_model.loader.load(sess,
tags,
self._model_dir)
output_names = set()
for sig_def in meta_graph_def.signature_def.values():
for output_tensor in sig_def.outputs.values():
output_names.add(output_tensor.name.replace(":0", ""))
return ",".join(output_names)
tf.reset_default_graph()
return ",".join(output_names)
def _load_saved_model(self):
"""Load the tensorflow saved model."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment