Skip to content

Commit

Permalink
Fix bug with resume (ultralytics#8912)
Browse files Browse the repository at this point in the history
* Fix bug with resume

* restore del on resume=false

* Update train.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
2 people authored and Clay Januhowski committed Sep 8, 2022
1 parent 4f64de6 commit 996484a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio
# Resume
best_fitness, start_epoch = 0.0, 0
if pretrained:
best_fitness, start_epoch, epochs = smart_resume(ckpt, optimizer, ema, weights, epochs, resume)
if resume:
best_fitness, start_epoch, epochs = smart_resume(ckpt, optimizer, ema, weights, epochs, resume)
del ckpt, csd

# DP mode
Expand Down

0 comments on commit 996484a

Please sign in to comment.