Update train.py test batch_size (#2148)

* Update train.py

* Update loss.py
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-02-06 10:29:32 -08:00
1 parent e9b3de463a
commit 86897e3663
2 files changed
+3 -4

No files matched your search

+2 -2
View File
@@ -190,7 +190,7 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
# Process 0
if rank in [-1, 0]:
ema.updates = start_epoch * nb // accumulate # set EMA updates
testloader = create_dataloader(test_path, imgsz_test, total_batch_size, gs, opt, # testloader
testloader = create_dataloader(test_path, imgsz_test, batch_size * 2, gs, opt, # testloader
hyp=hyp, cache=opt.cache_images and not opt.notest, rect=True, rank=-1,
world_size=opt.world_size, workers=opt.workers,
pad=0.5, prefix=colorstr('val: '))[0]
@@ -338,7 +338,7 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
final_epoch = epoch + 1 == epochs
if not opt.notest or final_epoch: # Calculate mAP
results, maps, times = test.test(opt.data,
batch_size=total_batch_size,
batch_size=batch_size * 2,
imgsz=imgsz_test,
model=ema.ema,
single_cls=opt.single_cls,