Skip to content

Commit

Permalink
Add assert message for clarification
Browse files Browse the repository at this point in the history
Clarify why assertion was thrown to users
  • Loading branch information
NanoCode012 committed Jul 14, 2020
1 parent 69364d6 commit 6364892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def train(hyp, tb_writer, opt, device):
dist.init_process_group(backend='nccl', init_method='env://') # distributed backend

opt.world_size = dist.get_world_size()
assert opt.batch_size % opt.world_size == 0
assert opt.batch_size % opt.world_size == 0, "Batch size is not a multiple of the number of devices given!"
opt.batch_size = opt.total_batch_size // opt.world_size
print(opt)

Expand Down

0 comments on commit 6364892

Please sign in to comment.