Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
6487fa7c
Unverified
Commit
6487fa7c
authored
Jan 11, 2018
by
Mikalai Drabovich
Committed by
GitHub
Jan 11, 2018
Browse files
Fix #3148
Opening gzipped datasets in binary, read-only mode fixes the issue
parent
9b57f41c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/mnist/dataset.py
official/mnist/dataset.py
+2
-2
No files found.
official/mnist/dataset.py
View file @
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment