We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c79ae38 commit cffaa58Copy full SHA for cffaa58
official/mnist/dataset.py
@@ -20,6 +20,7 @@
20
import gzip
21
import os
22
import shutil
23
+import tempfile
24
25
import numpy as np
26
from six.moves import urllib
@@ -67,7 +68,7 @@ def download(directory, filename):
67
68
tf.gfile.MakeDirs(directory)
69
# CVDF mirror of http://yann.lecun.com/exdb/mnist/
70
url = 'https://storage.googleapis.com/cvdf-datasets/mnist/' + filename + '.gz'
- zipped_filepath = filepath + '.gz'
71
+ _, zipped_filepath = tempfile.mkstemp(suffix='.gz')
72
print('Downloading %s to %s' % (url, zipped_filepath))
73
urllib.request.urlretrieve(url, zipped_filepath)
74
with gzip.open(zipped_filepath, 'rb') as f_in, \
0 commit comments