Commit c9285547 authored by Chris Tessum's avatar Chris Tessum Committed by pkulzc
Browse files

Change graph_def file opening mode from to 'rb' (#6071)

As discussed here: https://github.com/tensorflow/tensorflow/issues/11312, this change allows this script to work in Python 3.
parent d58f7590
...@@ -65,7 +65,7 @@ def build_inference_graph(image_tensor, inference_graph_path): ...@@ -65,7 +65,7 @@ def build_inference_graph(image_tensor, inference_graph_path):
detected_labels_tensor: Detected labels. Int64 tensor, detected_labels_tensor: Detected labels. Int64 tensor,
shape=[num_detections] shape=[num_detections]
""" """
with tf.gfile.Open(inference_graph_path, 'r') as graph_def_file: with tf.gfile.Open(inference_graph_path, 'rb') as graph_def_file:
graph_content = graph_def_file.read() graph_content = graph_def_file.read()
graph_def = tf.GraphDef() graph_def = tf.GraphDef()
graph_def.MergeFromString(graph_content) graph_def.MergeFromString(graph_content)
......
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