print('Optimizer stripped from %s' % f)
This commit is contained in:
parent
23f85a68b8
commit
d6d6fb5e5b
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue