Skip to content

Commit

Permalink
Add torch DP warning (ultralytics#3698)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jun 19, 2021
1 parent 10ea8f5 commit f3deaba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary

# DP mode
if cuda and RANK == -1 and torch.cuda.device_count() > 1:
logging.warning('DP not recommended, instead use torch.distributed.run for best DDP Multi-GPU results.\n'
'See Multi-GPU Tutorial at https://github.com/ultralytics/yolov5/issues/475 to get started.')
model = torch.nn.DataParallel(model)

# SyncBatchNorm
Expand Down

0 comments on commit f3deaba

Please sign in to comment.