HobbitLong / SupContrast

PyTorch implementation of "Supervised Contrastive Learning" (and SimCLR incidentally)
BSD 2-Clause "Simplified" License
3.06k stars 528 forks source link

Training on custom dataset #69

Open himansh1314 opened 3 years ago

himansh1314 commented 3 years ago

I was able to train the encoder model with projection head on a custom dataset, but when training the classification head with softmax activation, there is no option, it only supports training on two datasets. Can you check that, or am I missing something? I think you only need to add the option in argument parser, otherwise the dataloader is already built in other files.

HobbitLong commented 3 years ago

Originally it only supports CIFAR-10, and CIFAR-100. Some pull request added custom dataset. You could also easily added the custom dataset option to main_linear.py, and a pull request is welcome.

RaphaelWag commented 3 years ago

@HobbitLong In my Repo https://github.com/RaphaelWag/SupContrast I added the possibility to use custom data sets with all methods. Do you want to pull it?

noreenanwar commented 1 year ago

I was able to train the encoder model with projection head on a custom dataset, but when training the classification head with softmax activation, there is no option, it only supports training on two datasets. Can you check that, or am I missing something? I think you only need to add the option in argument parser, otherwise the dataloader is already built in other files.

hi, can you please guide me on how did you train this model on a customized dataset?