From 33778f56cea5813fdc2918e5a84ee71fe5ee9c28 Mon Sep 17 00:00:00 2001 From: ma_anjum95 Date: Wed, 21 Mar 2018 11:23:03 +0500 Subject: [PATCH] Fixed a bug in pascal_to_tfrecords. The image should be opened as a binary file other wise it gives encoding error. --- datasets/pascalvoc_to_tfrecords.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasets/pascalvoc_to_tfrecords.py b/datasets/pascalvoc_to_tfrecords.py index 9ac20169b..27a1d898d 100644 --- a/datasets/pascalvoc_to_tfrecords.py +++ b/datasets/pascalvoc_to_tfrecords.py @@ -80,7 +80,7 @@ def _process_image(directory, name): """ # Read the image file. filename = directory + DIRECTORY_IMAGES + name + '.jpg' - image_data = tf.gfile.FastGFile(filename, 'r').read() + image_data = tf.gfile.FastGFile(filename, 'rb').read() # Read the XML annotation file. filename = os.path.join(directory, DIRECTORY_ANNOTATIONS, name + '.xml')