From d01e56cbddfec5e7b4ede043c73d48715cb4dda4 Mon Sep 17 00:00:00 2001 From: iumyx2612 <69593462+iumyx2612@users.noreply.github.com> Date: Sat, 11 Dec 2021 00:06:27 +0700 Subject: [PATCH] Update `strip_optimizer()` (#5949) Replace 'training_result' with 'best_fitness' in strip_optimizer() to match key with ckpt from train.py --- utils/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index bbb9054a7235..6cc658cc3150 100755 --- a/utils/general.py +++ b/utils/general.py @@ -738,7 +738,7 @@ def strip_optimizer(f='best.pt', s=''): # from utils.general import *; strip_op x = torch.load(f, map_location=torch.device('cpu')) if x.get('ema'): x['model'] = x['ema'] # replace model with ema - for k in 'optimizer', 'training_results', 'wandb_id', 'ema', 'updates': # keys + for k in 'optimizer', 'best_fitness', 'wandb_id', 'ema', 'updates': # keys x[k] = None x['epoch'] = -1 x['model'].half() # to FP16