W&B ID reset on training completion (#1852)

This commit is contained in:
Glenn Jocher 2021-01-06 16:39:03 -08:00 committed by GitHub
parent 84ad6080ae
commit 4f2341c0ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() 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' # Strip optimizer from 'f' to finalize training, optionally save as 's'
x = torch.load(f, map_location=torch.device('cpu')) x = torch.load(f, map_location=torch.device('cpu'))
x['optimizer'] = None for key in 'optimizer', 'training_results', 'wandb_id':
x['training_results'] = None x[key] = None
x['epoch'] = -1 x['epoch'] = -1
x['model'].half() # to FP16 x['model'].half() # to FP16
for p in x['model'].parameters(): for p in x['model'].parameters():