I don’t have CIFAR10 data locally, and then I download one, but it doesn’t download automatically, and the read fails.
import torchvision as tv
import torchvision.transforms as transforms
from torchvision.transforms import ToPILImage
import torch as t

transform = transforms.Compose([
    transforms.ToTensor()  
    ,transforms.Normalize((0.5,0.5,0.5),(0.5,0.5,0.5))  
])
trainset = tv.datasets.CIFAR10(
    root = './data',
    train = True,
    download = True, 
    transform = transform
)
trainloader = t.utils.data.DataLoader(
            trainset,
            batch_size = 4,
            shuffle = True,
            num_workers=2
)

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-38-355678cb95ef> in <module>
      1 trainloader = t.utils.data.DataLoader(
----> 2             trainset,
      3             batch_size = 4,
      4             shuffle = True,
      5             num_workers=2

NameError: name 'trainset' is not defined

Best