Open judgment404 opened 15 hours ago
Thank you for your interest in our work! Here are a few notes to help you replicate our results:
Use the Correct Training Script: Run the training using the following command to ensure you're using the same hyperparameters as in our paper:
SelEx/methods/contrastive_training
to ensure you're using the same hyperparameters as in our paper:
python contrastive_training.py
requirements.txt
. Using lower versions like 1.x leads to reduced performance.unsupervised_smoothing
parameter to 1.0
, for other fine-grained datasets (Scars, Pets, Aircraft) to 0.5
and for generic datasets to 0.1
.
--unsupervised_smoothing 1.0
Feel free to reach out if you have any more questions or need further assistance!
Last and Best Epoch Evaluations: I also noticed that the reports for the best and last epochs in the final output are empty. This suggests that in the following lines of code
print("Reports for the best checkpoint:")
os.system("CUDA_VISIBLE_DEVICES="+str(args.gpu_id)+" python ../clustering/extract_features.py --dataset "+args.dataset_name+
" --warmup_model_dir "+ args.model_path.replace('(','\(').replace(')','\)').replace('|','\|'))
os.system("CUDA_VISIBLE_DEVICES="+str(args.gpu_id)+" python ../clustering/k_means.py --dataset "+args.dataset_name+
" --unbalanced "+str(int(args.unbalanced)))
It seems that the scripts extract_features.py
and the subsequent k_means.py
are not executing properly. This might be due to insufficient permissions to run OS commands from within the Python script. As a workaround, please run these two steps manually using the checkpoint address printed at the end of the reports.
Let me know if this solves the problem.
Thanks for your work! I attempted to train on CUB and installed
kmeans_pytorch
directly from the GitHub repository https://github.com/subhadarship/kmeans_pytorch. The final results were:I tried to change the seed and ran it 5 times, but I got similar numbers: 71 or 70, which are lower than the number in the paper (73). I also tried to train on the aircraft dataset, but the number I got was 51, which is also lower than the paper's number (57). I trained using the default hyperparameters in
contrastive_train.sh
, and I’m not sure if I misconfigured the training parameters or something else.Do you have any suggestions on how I might address this issue? Additionally, would it be possible to access your training weights? Thank you!