print('Optimizer stripped from %s' % f)

This commit is contained in:
Glenn Jocher 2020-05-24 20:30:30 -07:00
parent 23f85a68b8
commit d6d6fb5e5b
1 changed files with 1 additions and 0 deletions

View File

@ -570,6 +570,7 @@ def strip_optimizer(f='weights/best.pt'): # from utils.utils import *; strip_op
# Strip optimizer from *.pt files for lighter files (reduced by 2/3 size) # Strip optimizer from *.pt files for lighter files (reduced by 2/3 size)
x = torch.load(f, map_location=torch.device('cpu')) x = torch.load(f, map_location=torch.device('cpu'))
x['optimizer'] = None x['optimizer'] = None
print('Optimizer stripped from %s' % f)
torch.save(x, f) torch.save(x, f)