-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Train and evaluate vanilla SimCLR #16
Comments
Hi, thank you for your interest in our work! I think you should run the SimCLR code with If you don't want to train the model again, maybe forcing the And by the way, I recommend Thank you again for your interest. |
Thanks a lot! |
If you have any problems, feel free to reopen the issue. |
I want to reproduce the experiment with the vanilla SimCLR in the paper. (Table 7)
I followed the instructions in the main page;
I run the below command to train vanilla SimCLR. (Since I have trouble in installing torchlars package, I changed the optimizer adam)
CUDA_VISIBLE_DEVICES=0,1,2,3 python3 -m torch.distributed.launch --nproc_per_node=4 train.py --dataset cifar10 --model resnet18 --mode simclr --shift_trans_type rotation --batch_size 32 --one_class_idx 0 --optimizer adam
After that, I tried the evaluation command.
python3 eval.py --mode ood_pre --dataset cifar10 --model resnet18 --ood_score simclr --shift_trans_type rotation --print_score --ood_samples 10 --resize_factor 0.54 --resize_fix --one_class_idx 0 --load_path {LOAD_PATH}
But I got errors.
Here are detailed logs.
Pre-compute global statistics...
axis size: 5000 5000 5000 5000
weight_sim: 1.0000
weight_shi: 0.0000
Pre-compute features...
Compute OOD scores... (score: simclr)
Traceback (most recent call last):
File "eval.py", line 23, in
train_loader=train_loader, simclr_aug=simclr_aug)
File "/home/hyun78/aya/CSI/evals/ood_pre.py", line 84, in eval_ood_detection
scores_id = get_scores(P, feats_id, ood_score).numpy()
File "/home/hyun78/aya/CSI/evals/ood_pre.py", line 121, in get_scores
score += (f_sim[shi] * P.axis[shi]).sum(dim=1).max().item() * P.weight_sim[shi]
IndexError: list index out of range
+) I think the vanilla version of SimCLR should be the same as the original SimCLR paper, but your training codes include shift layers. I don't make sure it is okay to include the additional backward steps (line74~80 in training/unsup/simclr.py) and shift layers(line100 in common/train.py).
The text was updated successfully, but these errors were encountered: