* Fixes #2942

* doc fix
This commit is contained in:
William Falcon 2020-08-13 21:54:57 -04:00 committed by GitHub
parent 48f658fbb5
commit 0c264689cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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')