"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "87a8abd4d30f6d4a8df5f7b2ad251ea732ffe6b8"
Commit c6a9fd81 authored by Changming Sun's avatar Changming Sun
Browse files

Update download_and_convert_mnist.py for 1.0 and python3 compatibility

parent c4a96bc3
...@@ -125,7 +125,7 @@ def _add_to_tfrecord(data_filename, labels_filename, num_images, ...@@ -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]}) png_string = sess.run(encoded_png, feed_dict={image: images[j]})
example = dataset_utils.image_to_tfexample( 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()) tfrecord_writer.write(example.SerializeToString())
...@@ -165,7 +165,7 @@ def _download_dataset(dataset_dir): ...@@ -165,7 +165,7 @@ def _download_dataset(dataset_dir):
_progress) _progress)
print() print()
with tf.gfile.GFile(filepath) as f: with tf.gfile.GFile(filepath) as f:
size = f.Size() size = f.size()
print('Successfully downloaded', filename, size, 'bytes.') print('Successfully downloaded', filename, size, 'bytes.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment