Twin-Contrastive-Learning
Twin-Contrastive-Learning copied to clipboard
How to prepare a new dataset for the method
Congratulations on your excellent work!
I'm trying to prepare a new dataset for testing the method on it but I think I'm missing some details.
Do you have detailed instructions of how to prepare it (besides the structured mentioned on data.py)?
Since now, thank you so much!
Bests
Hi, what kind of data would you like to test? For image data, you could use the ImageFolder structure provided by PyTorch (https://pytorch.org/vision/stable/generated/torchvision.datasets.ImageFolder.html).
FYI, there is a similar issue in the previous repo (https://github.com/Yunfan-Li/Contrastive-Clustering/issues/10). Perhaps it would be helpful.
Best
It worked perfectly, thanks!
An additional question: in your previous work (Contrastive Clustering) there was a cluster.py which allowed to apply trained model on test images. I could not figure out which function should I use to test trained model on test samples here.
Could you help me ?
Plus, boost should take some pretrained model? I tried to load pretrained checkpoint generated from train.py but it did not work.
In this implementation, the clustering performance is evaluated during the training process. The evaluation function is at line 252 in train.py:
test_stats = evaluate(data_loader_val, model, device)
The returned test_stats contains the clustering performance metrics.
For the second question, have you checked the "--resume" argument to make sure it corresponds to the pre-trained model? What is the error message?