Преглед на файлове

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

This reverts commit c6a4f783080c5310ce0e3244daa31af57df12def.

Fixed tensorflow/tensorflow#4981
Justine Tunney преди 9 години
родител
ревизия
e93fdccac0
променени са 3 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      im2txt/im2txt/data/build_mscoco_data.py
  2. 1 1
      inception/inception/data/build_image_data.py
  3. 1 1
      inception/inception/data/build_imagenet_data.py

+ 1 - 1
im2txt/im2txt/data/build_mscoco_data.py

@@ -210,7 +210,7 @@ def _to_sequence_example(image, decoder, vocab):
   Returns:
     A SequenceExample proto.
   """
-  with open(image.filename, "r") as f:
+  with tf.gfile.FastGFile(image.filename, "r") as f:
     encoded_image = f.read()
 
   try:

+ 1 - 1
inception/inception/data/build_image_data.py

@@ -199,7 +199,7 @@ def _process_image(filename, coder):
     width: integer, image width in pixels.
   """
   # Read the image file.
-  with open(filename, 'r') as f:
+  with tf.gfile.FastGFile(filename, 'r') as f:
     image_data = f.read()
 
   # Convert any PNG to JPEG's for consistency.

+ 1 - 1
inception/inception/data/build_imagenet_data.py

@@ -313,7 +313,7 @@ def _process_image(filename, coder):
     width: integer, image width in pixels.
   """
   # Read the image file.
-  with open(filename, 'r') as f:
+  with tf.gfile.FastGFile(filename, 'r') as f:
     image_data = f.read()
 
   # Clean the dirty data.