Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2b4f7b4

Browse files
authored
Allow mnist data to be writen to remote file system. (tensorflow#3890)
1 parent 77d3bbe commit 2b4f7b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

official/mnist/dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def download(directory, filename):
7070
zipped_filepath = filepath + '.gz'
7171
print('Downloading %s to %s' % (url, zipped_filepath))
7272
urllib.request.urlretrieve(url, zipped_filepath)
73-
with gzip.open(zipped_filepath, 'rb') as f_in, open(filepath, 'wb') as f_out:
73+
with gzip.open(zipped_filepath, 'rb') as f_in, \
74+
tf.gfile.Open(filepath, 'wb') as f_out:
7475
shutil.copyfileobj(f_in, f_out)
7576
os.remove(zipped_filepath)
7677
return filepath

0 commit comments

Comments
 (0)