From 63648925288d63a21174a4dd28f92dbfebfeb75a Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Tue, 14 Jul 2020 19:16:15 +0700 Subject: [PATCH] Add assert message for clarification Clarify why assertion was thrown to users --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 2eb0a76ef137..7494af2754b5 100644 --- a/train.py +++ b/train.py @@ -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)