updates
This commit is contained in:
parent
4b424b2381
commit
b88c4568ba
|
@ -562,11 +562,15 @@ def print_model_biases(model):
|
||||||
'classification: %.2f+/-%.2f' % (b[:, 5:].mean(), b[:, 5:].std()))
|
'classification: %.2f+/-%.2f' % (b[:, 5:].mean(), b[:, 5:].std()))
|
||||||
|
|
||||||
|
|
||||||
def strip_optimizer_from_checkpoint(filename='weights/best.pt'):
|
def strip_optimizer(f='weights/best.pt'):
|
||||||
# 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)
|
||||||
a = torch.load(filename, map_location='cpu')
|
x = torch.load(f)
|
||||||
a['optimizer'] = []
|
x['optimizer'] = None
|
||||||
torch.save(a, filename.replace('.pt', '_lite.pt'))
|
# x['training_results'] = None
|
||||||
|
# x['epoch'] = -1
|
||||||
|
# for p in x['model']:
|
||||||
|
# p.requires_grad = True
|
||||||
|
torch.save(x, f)
|
||||||
|
|
||||||
|
|
||||||
def coco_class_count(path='../coco/labels/train2014/'):
|
def coco_class_count(path='../coco/labels/train2014/'):
|
||||||
|
|
Loading…
Reference in New Issue