"src/vscode:/vscode.git/clone" did not exist on "85f1c192824b036f8f2a32eb3e1df3c513224138"
Commit c6a4f783 authored by Christopher Shallue's avatar Christopher Shallue
Browse files

Use open() instead of tf.gfile.FastGFile()

parent 2cbd3375
...@@ -210,7 +210,7 @@ def _to_sequence_example(image, decoder, vocab): ...@@ -210,7 +210,7 @@ def _to_sequence_example(image, decoder, vocab):
Returns: Returns:
A SequenceExample proto. A SequenceExample proto.
""" """
with tf.gfile.FastGFile(image.filename, "r") as f: with open(image.filename, "r") as f:
encoded_image = f.read() encoded_image = f.read()
try: try:
......
...@@ -199,7 +199,8 @@ def _process_image(filename, coder): ...@@ -199,7 +199,8 @@ def _process_image(filename, coder):
width: integer, image width in pixels. width: integer, image width in pixels.
""" """
# Read the image file. # Read the image file.
image_data = tf.gfile.FastGFile(filename, 'r').read() with open(filename, 'r') as f:
image_data = f.read()
# Convert any PNG to JPEG's for consistency. # Convert any PNG to JPEG's for consistency.
if _is_png(filename): if _is_png(filename):
......
...@@ -313,7 +313,8 @@ def _process_image(filename, coder): ...@@ -313,7 +313,8 @@ def _process_image(filename, coder):
width: integer, image width in pixels. width: integer, image width in pixels.
""" """
# Read the image file. # Read the image file.
image_data = tf.gfile.FastGFile(filename, 'r').read() with open(filename, 'r') as f:
image_data = f.read()
# Clean the dirty data. # Clean the dirty data.
if _is_png(filename): if _is_png(filename):
......
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