Skip to content

Commit

Permalink
Update strip_optimizer() (ultralytics#5949)
Browse files Browse the repository at this point in the history
Replace 'training_result' with 'best_fitness' in strip_optimizer() to match key with ckpt from train.py
  • Loading branch information
iumyx2612 committed Dec 10, 2021
1 parent f716e09 commit d01e56c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d01e56c

Please sign in to comment.