From 2487b0694f362b6927a469286c801519267c2487 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 26 Sep 2019 12:08:40 +0200 Subject: [PATCH] updates --- train.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/train.py b/train.py index deb74928..7d394829 100644 --- a/train.py +++ b/train.py @@ -134,11 +134,12 @@ def train(): if opt.transfer or opt.prebias: # transfer learning edge (yolo) layers nf = int(model.module_defs[model.yolo_layers[0] - 1]['filters']) # yolo layer size (i.e. 255) - for p in optimizer.param_groups: - # lower param count allows more aggressive training settings: i.e. SGD ~0.1 lr0, ~0.9 momentum - p['lr'] *= 100 # lr gain - if p.get('momentum') is not None: # for SGD but not Adam - p['momentum'] *= 0.9 + if opt.prebias: + for p in optimizer.param_groups: + # lower param count allows more aggressive training settings: i.e. SGD ~0.1 lr0, ~0.9 momentum + p['lr'] *= 100 # lr gain + if p.get('momentum') is not None: # for SGD but not Adam + p['momentum'] *= 0.9 for p in model.parameters(): if opt.prebias and p.numel() == nf: # train (yolo biases)