Skip to content

Commit

Permalink
Use open() instead of tf.gfile.FastGFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
cshallue committed Oct 1, 2016
1 parent 2cbd337 commit c6a4f78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion im2txt/im2txt/data/build_mscoco_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _to_sequence_example(image, decoder, vocab):
Returns:
A SequenceExample proto.
"""
with tf.gfile.FastGFile(image.filename, "r") as f:
with open(image.filename, "r") as f:
encoded_image = f.read()

try:
Expand Down
3 changes: 2 additions & 1 deletion inception/inception/data/build_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def _process_image(filename, coder):
width: integer, image width in pixels.
"""
# 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.
if _is_png(filename):
Expand Down
3 changes: 2 additions & 1 deletion inception/inception/data/build_imagenet_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ def _process_image(filename, coder):
width: integer, image width in pixels.
"""
# 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.
if _is_png(filename):
Expand Down

0 comments on commit c6a4f78

Please sign in to comment.