facebookresearch / deepcluster

Deep Clustering for Unsupervised Learning of Visual Features
Other
1.66k stars 324 forks source link

AttributeError: 'CIFAR10' object has no attribute 'imgs' #74

Closed Hiiragi0107 closed 3 years ago

Hiiragi0107 commented 3 years ago

Hello. I tried with the CIFAR10 dataset and got an error like the one in the title. I would like to know how to solve this problem. This may be an elementary question, but thank you for your help.

WARNING clustering 50000 points to 10000 centroids: please provide at least 390000 training points Traceback (most recent call last): File "main.py", line 333, in main(args) File "main.py", line 166, in main dataset.imgs) AttributeError: 'CIFAR10' object has no attribute 'imgs'

mathildecaron31 commented 3 years ago

Hi, This code is written to work with "ImageFolder" dataset (https://pytorch.org/docs/stable/torchvision/datasets.html#imagefolder). If you use it with another dataset you would need to perform some adaptations because for example CIFAR10 dataset (https://pytorch.org/docs/stable/_modules/torchvision/datasets/cifar.html#CIFAR10) does not have an imgs attribute.

Hiiragi0107 commented 3 years ago

Thanks for the reply. Once I converted cifar10 to jpg format, I loaded it with ImageFolder. It worked well. Thanks.

happy20200 commented 2 years ago

Thanks for the reply. Once I converted cifar10 to jpg format, I loaded it with ImageFolder. It worked well. Thanks.

i meet the same problem, but cant solve, please tell me how to converted cifar10 to jpg format