From 5a8efa5c1d5f8a0099f649e3af0d3853f3334b50 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 23 Apr 2020 14:32:28 -0700 Subject: [PATCH] auto --accumulate --- train.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/train.py b/train.py index e65161e5..ddeda1a7 100644 --- a/train.py +++ b/train.py @@ -58,7 +58,7 @@ def train(): data = opt.data epochs = opt.epochs # 500200 batches at bs 64, 117263 images = 273 epochs batch_size = opt.batch_size - accumulate = opt.accumulate # effective bs = batch_size * accumulate = 16 * 4 = 64 + accumulate = max(round(64 / batch_size), 1) # accumulate n times before optimizer update (bs 64) weights = opt.weights # initial training weights imgsz_min, imgsz_max, imgsz_test = opt.img_size # img sizes (min, max, test) @@ -387,7 +387,6 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--epochs', type=int, default=300) # 500200 batches at bs 16, 117263 COCO images = 273 epochs parser.add_argument('--batch-size', type=int, default=16) # effective bs = batch_size * accumulate = 16 * 4 = 64 - parser.add_argument('--accumulate', type=int, default=4, help='batches to accumulate before optimizing') parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='*.cfg path') parser.add_argument('--data', type=str, default='data/coco2017.data', help='*.data path') parser.add_argument('--multi-scale', action='store_true', help='adjust (67%% - 150%%) img_size every 10 batches')