From 852487654f1cb0b136b3668087021013e2dd2c9e Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 24 Aug 2019 12:52:52 +0200 Subject: [PATCH] updates --- utils/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 5932c8b8..a067f7a1 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -562,14 +562,17 @@ def print_model_biases(model): 'classification: %.2f+/-%.2f' % (b[:, 5:].mean(), b[:, 5:].std())) -def strip_optimizer(f='weights/best.pt'): +def strip_optimizer(f='weights/best.pt'): # from utils.utils import *; strip_optimizer() # Strip optimizer from *.pt files for lighter files (reduced by 2/3 size) x = torch.load(f) x['optimizer'] = None # x['training_results'] = None # x['epoch'] = -1 - # for p in x['model']: - # p.requires_grad = True + # for p in x['model'].values(): + # try: + # p.requires_grad = True + # except: + # pass torch.save(x, f)