Skip to content

Commit 3ec4114

Browse files
glenn-jocherClay Januhowski
authored andcommitted
Fix bias warmup LR init (ultralytics#8356)
Per ultralytics#8352
1 parent 3bffd6f commit 3ec4114

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
335335
accumulate = max(1, np.interp(ni, xi, [1, nbs / batch_size]).round())
336336
for j, x in enumerate(optimizer.param_groups):
337337
# bias lr falls from 0.1 to lr0, all other lrs rise from 0.0 to lr0
338-
x['lr'] = np.interp(ni, xi, [hyp['warmup_bias_lr'] if j == 2 else 0.0, x['initial_lr'] * lf(epoch)])
338+
x['lr'] = np.interp(ni, xi, [hyp['warmup_bias_lr'] if j == 0 else 0.0, x['initial_lr'] * lf(epoch)])
339339
if 'momentum' in x:
340340
x['momentum'] = np.interp(ni, xi, [hyp['warmup_momentum'], hyp['momentum']])
341341

0 commit comments

Comments
 (0)