Skip to content

Instantly share code, notes, and snippets.

@sadimanna
Created June 30, 2021 10:33
Show Gist options
  • Select an option

  • Save sadimanna/4e06a4c7a107ede1b623203e65f23a20 to your computer and use it in GitHub Desktop.

Select an option

Save sadimanna/4e06a4c7a107ede1b623203e65f23a20 to your computer and use it in GitHub Desktop.
transform = transforms.Compose(
[transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
batch_size = 4
trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
download=True, transform=transform)
trainloader = torch.utils.data.DataLoader(trainset, batch_size=batch_size,
shuffle=True, num_workers=2)
testset = torchvision.datasets.CIFAR10(root='./data', train=False,
download=True, transform=transform)
testloader = torch.utils.data.DataLoader(testset, batch_size=batch_size,
shuffle=False, num_workers=2)
classes = ('plane', 'car', 'bird', 'cat',
'deer', 'dog', 'frog', 'horse', 'ship', 'truck')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment