diff --git a/train.py b/train.py index 12af2a305572..d24ac57df23d 100644 --- a/train.py +++ b/train.py @@ -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