Commit a9c4c8be authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

Merge branch 'fixurls' into 'master'

Use webarchive to download mnist

See merge request !2
parents 27d58c55 36f8a677
Pipeline #7107 passed with stages
in 7 minutes and 52 seconds
......@@ -22,7 +22,7 @@ The MNIST Database is a database of handwritten digits, which has a training
set of 60,000 examples, and a test set of 10,000 examples. It is a subset of
a larger set available from NIST. The digits have been size-normalized and
centered in a fixed-size image. You can download the MNIST database from:
http://yann.lecun.com/exdb/mnist/
https://web-beta.archive.org/web/20161231041016/http://yann.lecun.com/exdb/mnist/
"""
from .query import Database
......
......@@ -21,12 +21,12 @@ import shutil
import os
class Database():
"""Wrapper class for the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/).
"""Wrapper class for the MNIST database of handwritten digits (https://web-beta.archive.org/web/20161231041016/http://yann.lecun.com/exdb/mnist/).
"""
def __init__(self, data_dir = None):
"""Creates the database. The data_dir argument should be the path to the directory
containing the four binary files available from http://yann.lecun.com/exdb/mnist/"""
containing the four binary files available from https://web-beta.archive.org/web/20161231041016/http://yann.lecun.com/exdb/mnist/"""
# initialize members
import os
self.m_labels = set(range(0,10))
......@@ -80,11 +80,11 @@ class Database():
elif not os.path.exists(directory):
os.makedirs(directory)
print("Downloading the mnist database from http://yann.lecun.com/exdb/mnist/ ...")
print("Downloading the mnist database from https://web-beta.archive.org/web/20161231041016/http://yann.lecun.com/exdb/mnist/ ...")
for f in self.m_mnist_filenames:
tmp_file = os.path.join(directory, f)
url = 'http://yann.lecun.com/exdb/mnist/'+f
url = 'https://web-beta.archive.org/web/20161231041016/http://yann.lecun.com/exdb/mnist/'+f
if sys.version_info[0] < 3:
# python2 technique for downloading a file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment