From 97a9a0f6c1d199bf4c7c502ed241350e65c11cfc Mon Sep 17 00:00:00 2001 From: William Falcon Date: Tue, 6 Aug 2019 18:02:22 -0400 Subject: [PATCH] Update trainer.py --- pytorch_lightning/models/trainer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index 6f07f925..574c8061 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -180,7 +180,8 @@ class Trainer(TrainerIO): # make DP and DDP mutually exclusive # single GPU will also use DP with devices=[0] - if self.data_parallel_device_ids: + requested_gpus = self.data_parallel_device_ids is not None + if requested_gpus and len(self.data_parallel_device_ids) > 0: self.use_dp = distributed_backend == 'dp' self.use_ddp = distributed_backend == 'ddp'