From eb8b39535acef14331c8c49ecba6391425480cbf Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 14 Nov 2019 17:32:28 -0800 Subject: [PATCH] updates --- utils/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index 8f375b58..e4d67e4d 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -578,7 +578,8 @@ def print_model_biases(model): def strip_optimizer(f='weights/last.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 = torch.load(f, map_location=torch.device('cpu')) + # x['epoch'] = 0 # uncomment to create a backbone x['optimizer'] = None torch.save(x, f)