[solved]Loading data for training


A dataset was loaded by
trainset = torchvision.datasets.CIFAR10(root=’./data’, train=True,
download=True, transform=transform)

but I would like to load the data from the local memory on my PC after downloading it once.
How should I modify the code to read the dataset that has been already downloaded?

Thank you for advance :slight_smile:

1 Like

If you want to use local dataset, you can give the path to the dataset on your system and set download=False.

1 Like

Hi Deepali,

Thank you for your response.
It worked by using download = False as you say:
train_dataset = MNIST(’./data’, download = False, transform = img_transform)

Thank your very much for your help :slight_smile:

Thanks :-).

Could you please mark the thread as solved, for the benefit of others.

1 Like

Thank you for your reply.
I renamed the post as solved. I will also modify the other posts soon.
Thank you for your suggestion!