Unverified Commit 6487fa7c authored by Mikalai Drabovich's avatar Mikalai Drabovich Committed by GitHub
Browse files

Fix #3148

Opening gzipped datasets in binary, read-only mode fixes the issue
parent 9b57f41c
......@@ -33,7 +33,7 @@ def read32(bytestream):
def check_image_file_header(filename):
"""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)
num_images = read32(f)
rows = read32(f)
......@@ -49,7 +49,7 @@ def check_image_file_header(filename):
def check_labels_file_header(filename):
"""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)
num_items = read32(f)
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