This commit is contained in:
Glenn Jocher 2019-11-14 18:20:54 -08:00
parent 2433a99451
commit fa7c517ece
1 changed files with 1 additions and 1 deletions

View File

@ -579,7 +579,7 @@ 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, map_location=torch.device('cpu'))
# x['epoch'] = 0 # uncomment to create a backbone
# x['epoch'] = -1 # uncomment to create a backbone
x['optimizer'] = None
torch.save(x, f)