From 43efec3cc4f27d6962d4bfe6061f908c5a1789d7 Mon Sep 17 00:00:00 2001 From: Yana Date: Tue, 9 Aug 2022 17:20:48 +0700 Subject: [PATCH 1/3] Fix bug with resume --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 9f67e93534d5..80ada7d86189 100644 --- a/train.py +++ b/train.py @@ -166,7 +166,7 @@ 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: + if resume: best_fitness, start_epoch, epochs = smart_resume(ckpt, optimizer, ema, weights, epochs, resume) del ckpt, csd From 8a6e34dc05bf3555ae59e61cbba9d9b18e090d60 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 17 Aug 2022 00:36:13 +0200 Subject: [PATCH 2/3] restore del on resume=false --- train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/train.py b/train.py index e47238fffa88..12c58adf49df 100644 --- a/train.py +++ b/train.py @@ -168,6 +168,7 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio best_fitness, start_epoch = 0.0, 0 if resume: best_fitness, start_epoch, epochs = smart_resume(ckpt, optimizer, ema, weights, epochs, resume) + if pretrained: del ckpt, csd # DP mode From e1e90a8bfd24eb6eff95883967622d2ceaab73cc Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 17 Aug 2022 00:36:56 +0200 Subject: [PATCH 3/3] Update train.py --- train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 12c58adf49df..d24ac57df23d 100644 --- a/train.py +++ b/train.py @@ -166,9 +166,9 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio # Resume best_fitness, start_epoch = 0.0, 0 - if resume: - best_fitness, start_epoch, epochs = smart_resume(ckpt, optimizer, ema, weights, epochs, resume) if pretrained: + if resume: + best_fitness, start_epoch, epochs = smart_resume(ckpt, optimizer, ema, weights, epochs, resume) del ckpt, csd # DP mode