pytorch_simple_CenterNet_45 icon indicating copy to clipboard operation
pytorch_simple_CenterNet_45 copied to clipboard

想要指定4,5,6,7这几张GPU进行训练该怎么设置

Open philiperss opened this issue 4 years ago • 4 comments

你好,python -m torch.distributed.launch --nproc_per_node NUM_GPUS train.py 这里我为NUM_GPUS为4的话,自动用的是前4张卡,那我如果想用后4张卡该怎么设置呢?

philiperss avatar Sep 02 '20 07:09 philiperss

try this

export CUDA_VISIBLE_DEVICES=4,5,6,7
python ... ...

zzzxxxttt avatar Sep 02 '20 08:09 zzzxxxttt

try this

export CUDA_VISIBLE_DEVICES=4,5,6,7
python ... ...

谢谢哦,解决了

philiperss avatar Sep 03 '20 02:09 philiperss

@zzzxxxttt 您好,单卡训练时可以指定GPU1卡,而不用0卡吗?因为0卡跑着别的程序,但是程序一直默认0卡训练。我在命令行按照您所提示的反映有问题

sunshehai avatar May 11 '22 07:05 sunshehai

@zzzxxxttt 您好,单卡训练时可以指定GPU1卡,而不用0卡吗?因为0卡跑着别的程序,但是程序一直默认0卡训练。我在命令行按照您所提示的反映有问题

export CUDA_VISIBLE_DEVICES=1
python train.py ...

zzzxxxttt avatar May 11 '22 10:05 zzzxxxttt