Преглед изворни кода

Update download_and_convert_mnist.py for 1.0 and python3 compatibility

Changming Sun пре 8 година
родитељ
комит
c6a9fd814f
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      slim/datasets/download_and_convert_mnist.py

+ 2 - 2
slim/datasets/download_and_convert_mnist.py

@@ -125,7 +125,7 @@ def _add_to_tfrecord(data_filename, labels_filename, num_images,
         png_string = sess.run(encoded_png, feed_dict={image: images[j]})
 
         example = dataset_utils.image_to_tfexample(
-            png_string, 'png', _IMAGE_SIZE, _IMAGE_SIZE, labels[j])
+            png_string, 'png'.encode(), _IMAGE_SIZE, _IMAGE_SIZE, labels[j])
         tfrecord_writer.write(example.SerializeToString())
 
 
@@ -165,7 +165,7 @@ def _download_dataset(dataset_dir):
                                                _progress)
       print()
       with tf.gfile.GFile(filepath) as f:
-        size = f.Size()
+        size = f.size()
       print('Successfully downloaded', filename, size, 'bytes.')