From 76f555c108fe8cee76a0fa66dae1d17bcff355ce Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 19 Mar 2019 12:34:12 +0200 Subject: [PATCH] multi_gpu multi_scale --- train.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 208c471f..7e22ec61 100644 --- a/train.py +++ b/train.py @@ -25,6 +25,8 @@ def train( if multi_scale: # pass maximum multi_scale size img_size = 608 + ms_index = -1 + ms_sizes = [320, 352, 384, 416, 448, 480, 512, 544, 576, 608] else: torch.backends.cudnn.benchmark = True # unsuitable for multiscale @@ -153,7 +155,9 @@ def train( # Multi-Scale training (320 - 608 pixels) every 10 batches if multi_scale and (i + 1) % 10 == 0: - dataloader.img_size = random.choice(range(10, 20)) * 32 + ms_index += 1 + dataloader.img_size = ms_sizes[ms_index] + # dataloader.img_size = random.choice(range(10, 20)) * 32 print('multi_scale img_size = %g' % dataloader.img_size) # Update best loss