updates
This commit is contained in:
parent
3072d72375
commit
2487b0694f
11
train.py
11
train.py
|
@ -134,11 +134,12 @@ def train():
|
||||||
if opt.transfer or opt.prebias: # transfer learning edge (yolo) layers
|
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)
|
nf = int(model.module_defs[model.yolo_layers[0] - 1]['filters']) # yolo layer size (i.e. 255)
|
||||||
|
|
||||||
for p in optimizer.param_groups:
|
if opt.prebias:
|
||||||
# lower param count allows more aggressive training settings: i.e. SGD ~0.1 lr0, ~0.9 momentum
|
for p in optimizer.param_groups:
|
||||||
p['lr'] *= 100 # lr gain
|
# lower param count allows more aggressive training settings: i.e. SGD ~0.1 lr0, ~0.9 momentum
|
||||||
if p.get('momentum') is not None: # for SGD but not Adam
|
p['lr'] *= 100 # lr gain
|
||||||
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():
|
for p in model.parameters():
|
||||||
if opt.prebias and p.numel() == nf: # train (yolo biases)
|
if opt.prebias and p.numel() == nf: # train (yolo biases)
|
||||||
|
|
Loading…
Reference in New Issue