hitbuyi
1
dataloader = datasets.CIFAR10
trainset = dataloader(root='./data', train=True, download=True,
transform=transform_train)
Now I want to get one sample of trainset to train for debugging my code ,how to write the code?
nivek
(Kevin T)
2
Based on your code, you should be able to get the first element by running this:
print(next(iter(trainset)))
You may find the examples on this page helpful.
hitbuyi
3
Thanks a lot, maybe
torch.utils.data.Subset(testset, subset_indices)
works