fastai / course-v3

The 3rd edition of course.fast.ai
https://course.fast.ai/
Apache License 2.0
4.9k stars 3.55k forks source link

deeplearning.net is down; datasets unreachable #577

Open Lauler opened 3 years ago

Lauler commented 3 years ago

The website http://deeplearning.net has been down for a while, meaning it has been impossible for several days to download some of the datasets in the tutorial (MNIST for example) through the provided download links.

garyhlai commented 3 years ago

+1

garyhlai commented 3 years ago

For MNIST, here is a workaround using Torchvision's dataset:

def get_data():
    import os
    import torchvision.datasets as datasets
    root = '../data'
    if not os.path.exists(root):
        os.mkdir(root)
    train_set = datasets.MNIST(root=root, train=True, download=True)
    test_set = datasets.MNIST(root=root, train=False, download=True)
    x_train, x_valid = train_set.train_data.split([50000, 10000])
    y_train, y_valid = train_set.train_labels.split([50000, 10000])
    return (x_train.view(50000, -1) / 256.0), y_train.float(), (x_valid.view(10000, -1))/ 256.0, y_valid.float()

x_train,y_train,x_valid,y_valid = get_data()

x_train,y_train,x_valid,y_valid should match the original ones