Skip to content

Commit

Permalink
Assert --image-weights not combined with DDP (ultralytics#3275)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed May 21, 2021
1 parent 7b36e38 commit 10d56d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ def train(hyp, opt, device, tb_writer=None):
device = torch.device('cuda', opt.local_rank)
dist.init_process_group(backend='nccl', init_method='env://') # distributed backend
assert opt.batch_size % opt.world_size == 0, '--batch-size must be multiple of CUDA device count'
assert not opt.image_weights, '--image-weights argument is not compatible with DDP training'
opt.batch_size = opt.total_batch_size // opt.world_size

# Hyperparameters
Expand Down

0 comments on commit 10d56d7

Please sign in to comment.