Commit f9df9323 authored by Tzu-Wei Huang's avatar Tzu-Wei Huang Committed by Soumith Chintala
Browse files

Fix dataset url (#314)

parent 7be960f5
...@@ -32,7 +32,7 @@ class CIFAR10(data.Dataset): ...@@ -32,7 +32,7 @@ class CIFAR10(data.Dataset):
""" """
base_folder = 'cifar-10-batches-py' base_folder = 'cifar-10-batches-py'
url = "http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz" url = "https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz"
filename = "cifar-10-python.tar.gz" filename = "cifar-10-python.tar.gz"
tgz_md5 = 'c58f30108f718f92721af3b95e74349a' tgz_md5 = 'c58f30108f718f92721af3b95e74349a'
train_list = [ train_list = [
...@@ -162,7 +162,7 @@ class CIFAR10(data.Dataset): ...@@ -162,7 +162,7 @@ class CIFAR10(data.Dataset):
class CIFAR100(CIFAR10): class CIFAR100(CIFAR10):
base_folder = 'cifar-100-python' base_folder = 'cifar-100-python'
url = "http://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz" url = "https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz"
filename = "cifar-100-python.tar.gz" filename = "cifar-100-python.tar.gz"
tgz_md5 = 'eb9058c3a382ffc7106e4002c42a8d85' tgz_md5 = 'eb9058c3a382ffc7106e4002c42a8d85'
train_list = [ train_list = [
......
...@@ -36,5 +36,12 @@ def download_url(url, root, filename, md5): ...@@ -36,5 +36,12 @@ def download_url(url, root, filename, md5):
if os.path.isfile(fpath) and check_integrity(fpath, md5): if os.path.isfile(fpath) and check_integrity(fpath, md5):
print('Using downloaded and verified file: ' + fpath) print('Using downloaded and verified file: ' + fpath)
else: else:
print('Downloading ' + url + ' to ' + fpath) try:
urllib.request.urlretrieve(url, fpath) print('Downloading ' + url + ' to ' + fpath)
urllib.request.urlretrieve(url, fpath)
except:
if url[:5] == 'https':
url = url.replace('https:', 'http:')
print('Failed download. Trying https -> http instead.'
' Downloading ' + url + ' to ' + fpath)
urllib.request.urlretrieve(url, fpath)
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