From fd004f56485d44c9c65b37c47d0e5f6165e1d944 Mon Sep 17 00:00:00 2001 From: Yana Date: Wed, 17 Aug 2022 05:58:30 +0700 Subject: [PATCH] Fix bug with resume (#8912) * Fix bug with resume * restore del on resume=false * Update train.py Co-authored-by: Glenn Jocher --- train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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