From 1115d6b86d4c163b31c9bba595ff0206c5402db9 Mon Sep 17 00:00:00 2001 From: Iz Beltagy Date: Fri, 17 Jul 2020 17:11:59 -0700 Subject: [PATCH] fix https://github.com/PyTorchLightning/pytorch-lightning/issues/2407 --- pytorch_lightning/trainer/distrib_data_parallel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/trainer/distrib_data_parallel.py b/pytorch_lightning/trainer/distrib_data_parallel.py index 4fb3a600b9e689..74f58fd5d6cf3c 100644 --- a/pytorch_lightning/trainer/distrib_data_parallel.py +++ b/pytorch_lightning/trainer/distrib_data_parallel.py @@ -528,7 +528,7 @@ def ddp_train(self, process_idx, q, model, is_master=False, proc_offset=0): if is_master: # source of truth is cuda for gpu idx gpus = os.environ['CUDA_VISIBLE_DEVICES'].split(',') - gpu_idx = int(gpus[self.local_rank]) + gpu_idx = self.local_rank self.root_gpu = gpu_idx torch.cuda.set_device(self.root_gpu)