parent
48f658fbb5
commit
0c264689cb
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue