Fix bug with resume (#8912)

* Fix bug with resume

* restore del on resume=false

* Update train.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
YanaandGlenn Jocher authored and GitHub committed 2022-08-17 00:58:30 +02:00
1 parent d1dfcab604
commit fd004f5648
1 file changed
+2 -1
+2 -1
View File
@@ -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