Yunfan-Li / Contrastive-Clustering

Code for the paper "Contrastive Clustering" (AAAI 2021)
MIT License
289 stars 92 forks source link

issue #11

Closed TryHard-LL closed 3 years ago

TryHard-LL commented 3 years ago

Hi, when i test the 'ImageNet-dogs',i get the error“IndexError: index 14 is out of bounds for axis 0 with size 1”, and i print the cost_matrix in 'evaluation.py',i only get [[0.]]. Is it because I trained less epoch?

Thanks.

Yunfan-Li commented 3 years ago

Have you checked the dimension of CCH?

TryHard-LL commented 3 years ago

I have set thd dimension of CCH with class_num

TryHard-LL commented 3 years ago

After 20 epochs, i tested 'ImageNet-dogs',i print len(indices) and i get 1,but 'CIFAR10/100' is True

TryHard-LL commented 3 years ago

`` ![Uploading image.png…]()

Yunfan-Li commented 3 years ago

Perhaps it is because the file organization of ImageNet-dogs is wrong. You may check the ground-truth labels and see if it contains 0-14.

TryHard-LL commented 3 years ago

I get the datasets from http://vision.stanford.edu/aditya86/ImageNetDogs/,it includes images and annotations . How do i deal with? Thanks.

Yunfan-Li commented 3 years ago

I command using ImageFolder following the instructions in https://pytorch.org/vision/stable/datasets.html#imagefolder.

Yunfan-Li commented 3 years ago

The dataset you downloaded seems to be inconsistent with the one used in the paper. In our experiments, the ImageNet-dogs data consists of 15 subclasses of the original Imagenet dataset, the indices of which are given in /datasets/ImageNet-dogs.txt.

TryHard-LL commented 3 years ago

I have already corrected the data consists of 15subclasses, and then I need to merge 'images' with 'annotations'?

Yunfan-Li commented 3 years ago

Please follow the instructions in https://pytorch.org/vision/stable/datasets.html#imagefolder and arrange images of different classes in different subfolders.

TryHard-LL commented 3 years ago

Now,i followed the indices and arrange images of different classes in in different subfolders with the indices,but i only get 2436 images...

Yunfan-Li commented 3 years ago

Each class contains 1300 images and thus there should be 19500 images in total.

TryHard-LL commented 3 years ago

The datasets with 120 classes downloaded from http://vision.stanford.edu/aditya86/ImageNetDogs, now, I process this dataset according to the index, but per class only has more than 100.

Yunfan-Li commented 3 years ago

Perhaps you need to download the ImageNet dataset and select its 15 subclasses.