From 2877ac928694908c5bd0c8b0ac47d85ff20ceb66 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 2 Sep 2019 14:28:13 +0200 Subject: [PATCH] updates Signed-off-by: Glenn Jocher --- train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 996e48da..f967b67a 100644 --- a/train.py +++ b/train.py @@ -123,7 +123,8 @@ def train(): 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 - p['momentum'] *= 0.9 + 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)