Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hipsternet/input_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Functions for downloading and reading MNIST data."""
import gzip
import os
import urllib
import urllib.request
import numpy
SOURCE_URL = 'http://yann.lecun.com/exdb/mnist/'

Expand All @@ -12,7 +12,7 @@ def maybe_download(filename, work_directory):
os.mkdir(work_directory)
filepath = os.path.join(work_directory, filename)
if not os.path.exists(filepath):
filepath, _ = urllib.urlretrieve(SOURCE_URL + filename, filepath)
filepath, _ = urllib.request.urlretrieve(SOURCE_URL + filename, filepath)
statinfo = os.stat(filepath)
print('Succesfully downloaded', filename, statinfo.st_size, 'bytes.')
return filepath
Expand Down