I’d like to get label which has only gender information from torchvision.datasets.CelebA
My code snippet is as follows:
trainset = torchvision.datasets.CelebA(..., download=True, split='train', target_type='attr', ...) trainloader = torch.utils.data.DataLoader(trainset, ...) for idx, (imgs, labels) in enumerate(trainlader): imgs = imgs.to(device) labels = labels.to(device)
What I really want to do is get labels only have gender information.
In this case, what should I do?