AttributeError: 'CIFAR10' object has no attribute 'train_labels'
See original GitHub issueFiles already downloaded and verified
Traceback (most recent call last):
File "/Federated-Learning-PyTorch/src/sampling.py", line 282, in <module>
d = cifar_noniid(dataset_train, num)
File "/Federated-Learning-PyTorch/src/sampling.py", line 248, in cifar_noniid
labels = np.array(dataset.train_labels)
AttributeError: 'CIFAR10' object has no attribute 'train_labels'
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
'CIFAR10' object has no attribute 'train_labels' #3 - GitHub
In recent versions, the variable for the labels for the training samples in torchvision.datasets.CIFAR10 is not called "train_labels" anymore, ...
Read more >cifar-10 - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from CIFAR-10 - Object Recognition in Images.
Read more >Is torchvision.datasets.cifar.CIFAR10 a list or not?
Slicing isnt supported by CIFAR10, which is why you are getting that error. If you want the first 10 you will have to...
Read more >Source code for torchvision.datasets.cifar - chsasank.com
Args: root (string): Root directory of dataset where directory ``cifar-10-batches-py`` exists. train (bool, optional): If True, creates dataset from ...
Read more >Final Project: Reproduce One Result of ”Understanding Deep ...
Resnet, and train that on random labels on the CIFAR10 dataset. ... AttributeError: 'CIFAR10RandomLabels' object has no attribute 'train_labels'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Change train_labels to targets
num_shards, num_imgs = 200, 250 200*250=50000 ,the multiplication of these need equal to 60,000.