Browse Source

Update `WORLD_SIZE` and `RANK` retrieval (#3670)

modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
2296f1546f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      train.py

+ 2
- 2
train.py View File

@@ -502,8 +502,8 @@ if __name__ == '__main__':
opt = parser.parse_args()

# Set DDP variables
opt.world_size = int(os.environ['WORLD_SIZE']) if 'WORLD_SIZE' in os.environ else 1
opt.global_rank = int(os.environ['RANK']) if 'RANK' in os.environ else -1
opt.world_size = int(getattr(os.environ, 'WORLD_SIZE', 1))
opt.global_rank = int(getattr(os.environ, 'RANK', -1))
set_logging(opt.global_rank)
if opt.global_rank in [-1, 0]:
check_git_status()

Loading…
Cancel
Save