Skip to content

Commit cffaa58

Browse files
authored
Update data model download location to temp dir. (tensorflow#3899)
1 parent c79ae38 commit cffaa58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

official/mnist/dataset.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import gzip
2121
import os
2222
import shutil
23+
import tempfile
2324

2425
import numpy as np
2526
from six.moves import urllib
@@ -67,7 +68,7 @@ def download(directory, filename):
6768
tf.gfile.MakeDirs(directory)
6869
# CVDF mirror of http://yann.lecun.com/exdb/mnist/
6970
url = 'https://storage.googleapis.com/cvdf-datasets/mnist/' + filename + '.gz'
70-
zipped_filepath = filepath + '.gz'
71+
_, zipped_filepath = tempfile.mkstemp(suffix='.gz')
7172
print('Downloading %s to %s' % (url, zipped_filepath))
7273
urllib.request.urlretrieve(url, zipped_filepath)
7374
with gzip.open(zipped_filepath, 'rb') as f_in, \

0 commit comments

Comments
 (0)