diff --git a/docs/source/debugging.rst b/docs/source/debugging.rst index 56c96607bc..19c75acae1 100644 --- a/docs/source/debugging.rst +++ b/docs/source/debugging.rst @@ -1,8 +1,8 @@ .. testsetup:: * from pytorch_lightning.trainer.trainer import Trainer - - .. _debugging: + +.. _debugging: Debugging ========= diff --git a/pytorch_lightning/accelerators/ddp_backend.py b/pytorch_lightning/accelerators/ddp_backend.py index 62e8344c17..2ecf084774 100644 --- a/pytorch_lightning/accelerators/ddp_backend.py +++ b/pytorch_lightning/accelerators/ddp_backend.py @@ -87,7 +87,7 @@ class DDPBackend(object): command = [sys.executable] + command # since this script sets the visible devices we replace the gpus flag with a number - num_gpus = os.environ['CUDA_VISIBLE_DEVICES'].split(',').__len__() + num_gpus = os.environ.get('CUDA_VISIBLE_DEVICES', []).split(',').__len__() if '--gpus' in command: gpu_flag_idx = command.index('--gpus')