Closed WYZKLNH closed 2 years ago
you can use CUDA_VISIBLE_DEVICES to control which gpu will be used
you can use CUDA_VISIBLE_DEVICES to control which gpu will be used
but I want to use all GPUS, one GPU for every process, maybe device_ids=[local_rank] is the only solution?
I met tough problems when running this line in trainer.py/_dist_train model = MMDistributedDataParallel(model.cuda())
It worked after modifying like this: model = MMDistributedDataParallel(model.cuda(), device_ids=[local_rank], find_unused_parameters=True)
This is because the model must be set the specific gpu when running parallel, or it will be put on all gpus, and the batch_size will change, then error will occur when calculating backproject. why other people didn't meet this problem?