Unverified Commit 1887a5fe authored by Neal Wu's avatar Neal Wu Committed by GitHub
Browse files

Merge pull request #3149 from MikalaiDrabovich/patch-1

Fix #3148
parents aafe60d5 6487fa7c
...@@ -33,7 +33,7 @@ def read32(bytestream): ...@@ -33,7 +33,7 @@ def read32(bytestream):
def check_image_file_header(filename): def check_image_file_header(filename):
"""Validate that filename corresponds to images for the MNIST dataset.""" """Validate that filename corresponds to images for the MNIST dataset."""
with tf.gfile.Open(filename) as f: with tf.gfile.Open(filename,'rb') as f:
magic = read32(f) magic = read32(f)
num_images = read32(f) num_images = read32(f)
rows = read32(f) rows = read32(f)
...@@ -49,7 +49,7 @@ def check_image_file_header(filename): ...@@ -49,7 +49,7 @@ def check_image_file_header(filename):
def check_labels_file_header(filename): def check_labels_file_header(filename):
"""Validate that filename corresponds to labels for the MNIST dataset.""" """Validate that filename corresponds to labels for the MNIST dataset."""
with tf.gfile.Open(filename) as f: with tf.gfile.Open(filename,'rb') as f:
magic = read32(f) magic = read32(f)
num_items = read32(f) num_items = read32(f)
if magic != 2049: if magic != 2049:
......
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