ultralytics 8.0.20 CLI yolo simplifications, DDP and ONNX fixes (#608)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sid Prabhakaran <s2siddhu@gmail.com>
This commit is contained in:
Glenn Jocher 2023-01-25 21:21:39 +01:00 committed by GitHub
parent 59d4335664
commit 15b3b0365a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 242 additions and 139 deletions

View file

@ -31,7 +31,7 @@ WORLD_SIZE = int(os.getenv('WORLD_SIZE', 1))
@contextmanager
def torch_distributed_zero_first(local_rank: int):
# Decorator to make all processes in distributed training wait for each local_master to do something
initialized = torch.distributed.is_initialized() # prevent 'Default process group has not been initialized' errors
initialized = torch.distributed.is_available() and torch.distributed.is_initialized()
if initialized and local_rank not in {-1, 0}:
dist.barrier(device_ids=[local_rank])
yield