소스 검색

Merge pull request #483 from cshallue/writer

Close the TFRecordWriter after use.
Chris Shallue 9 년 전
부모
커밋
2cbd337592
3개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      im2txt/im2txt/data/build_mscoco_data.py
  2. 1 0
      inception/inception/data/build_image_data.py
  3. 1 0
      inception/inception/data/build_imagenet_data.py

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

@@ -286,6 +286,7 @@ def _process_image_files(thread_index, ranges, name, images, decoder, vocab,
               (datetime.now(), thread_index, counter, num_images_in_thread))
         sys.stdout.flush()
 
+    writer.close()
     print("%s [thread %d]: Wrote %d image-caption pairs to %s" %
           (datetime.now(), thread_index, shard_counter, output_file))
     sys.stdout.flush()

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

@@ -273,6 +273,7 @@ def _process_image_files_batch(coder, thread_index, ranges, name, filenames,
               (datetime.now(), thread_index, counter, num_files_in_thread))
         sys.stdout.flush()
 
+    writer.close()
     print('%s [thread %d]: Wrote %d images to %s' %
           (datetime.now(), thread_index, shard_counter, output_file))
     sys.stdout.flush()

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

@@ -399,6 +399,7 @@ def _process_image_files_batch(coder, thread_index, ranges, name, filenames,
               (datetime.now(), thread_index, counter, num_files_in_thread))
         sys.stdout.flush()
 
+    writer.close()
     print('%s [thread %d]: Wrote %d images to %s' %
           (datetime.now(), thread_index, shard_counter, output_file))
     sys.stdout.flush()