Allocating specific GPUs using Pytorch in ImageNet example code

Viewed 215

PyTorch has an example here on how to train networks on ImageNet. At line 102, we have ngpus_per_node = torch.cuda.device_count() which takes all the GPU's to allocate the computation.

I have 8 GPUs and the first four of them are busy. How to modify the code so that I can pass the indices of the available GPUs?

0 Answers
Related