From 4f2341c0ad0d0cb15dad0f20bc6f4d92380804ee Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 6 Jan 2021 16:39:03 -0800 Subject: [PATCH] W&B ID reset on training completion (#1852) --- utils/general.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/general.py b/utils/general.py index 18285512..22647f6c 100755 --- a/utils/general.py +++ b/utils/general.py @@ -350,8 +350,8 @@ def non_max_suppression(prediction, conf_thres=0.25, iou_thres=0.45, classes=Non def strip_optimizer(f='weights/best.pt', s=''): # from utils.general import *; strip_optimizer() # Strip optimizer from 'f' to finalize training, optionally save as 's' x = torch.load(f, map_location=torch.device('cpu')) - x['optimizer'] = None - x['training_results'] = None + for key in 'optimizer', 'training_results', 'wandb_id': + x[key] = None x['epoch'] = -1 x['model'].half() # to FP16 for p in x['model'].parameters():