Open MrLinNing opened 4 years ago
my problem is "ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 50000 and the array at index 1 has size 60000 @AshwinRJ Have you solved @MrLinNing
Files 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'
I met the same problems as you before, I tried to use dataset.targets
instead and it just worked fine.
So my code is:
labels = np.array(dataset.targets)
my problem is "ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 50000 and the array at index 1 has size 60000 @AshwinRJ Have you solved @MrLinNing
Could you provide a more detailed error message? For example, which line is this error come from?
my problem is "ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 50000 and the array at index 1 has size 60000 @AshwinRJ Have you solved @MrLinNing
num_shards, num_imgs = 200, 250 200*250=50000 ,the multiplication of these need equal to 60,000.
Files 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'
Change train_labels to targets