Yunfan-Li / Twin-Contrastive-Learning

Code for the paper "Twin Contrastive Learning for Online Clustering" (IJCV 2022)
59 stars 11 forks source link

How to train on single GPU ? #1

Open ThorPham opened 2 years ago

ThorPham commented 2 years ago

Thank you for great job. I want to train on single GPU. Can i do that ?

Yunfan-Li commented 2 years ago

Maybe you could set --nproc_per_node=1.

ThorPham commented 2 years ago

@Yunfan-Li thank you for your support . I have bug like this OMP_NUM_THREADS=1 python -m torch.distributed.launch --nproc_per_node=1 python train.py --batch_size 64 --model resnet18 --nb_cluster 30 --data_path /home/thorpham/Documents/vaipe/explore_data/img_by_name --dataset mydata --device cuda Screenshot from 2022-07-29 22-50-22

ThorPham commented 2 years ago

sorry my bad. I write 2 name python in cmd

Breeze-J commented 1 year ago

sorry my bad. I write 2 name python in cmd Could you please solve this problem? I have another question, is it okay to just change 4 to 1? OMP_NUM_THREADS=1 python -m torch.distributed.launch --nproc_per_node=1 train.py Will it work if changed to the above?

Yunfan-Li commented 1 year ago

Yes. You could change --nproc_per_node according to the number of GPUs available.