glenn-jocher commited on
Commit
1e9cf6a
·
1 Parent(s): c494a11

add file sizes to ckpt ops

Browse files
Files changed (1) hide show
  1. utils/utils.py +2 -2
utils/utils.py CHANGED
@@ -636,7 +636,7 @@ def strip_optimizer(f='weights/best.pt'): # from utils.utils import *; strip_op
636
  x['optimizer'] = None
637
  x['model'].half() # to FP16
638
  torch.save(x, f)
639
- print('Optimizer stripped from %s' % f)
640
 
641
 
642
  def create_pretrained(f='weights/best.pt', s='weights/pretrained.pt'): # from utils.utils import *; create_pretrained()
@@ -651,7 +651,7 @@ def create_pretrained(f='weights/best.pt', s='weights/pretrained.pt'): # from u
651
  for p in x['model'].parameters():
652
  p.requires_grad = True
653
  torch.save(x, s)
654
- print('%s saved as pretrained checkpoint %s' % (f, s))
655
 
656
 
657
  def coco_class_count(path='../coco/labels/train2014/'):
 
636
  x['optimizer'] = None
637
  x['model'].half() # to FP16
638
  torch.save(x, f)
639
+ print('Optimizer stripped from %s, %.1fMB' % (f, os.path.getsize(f) / 1E6))
640
 
641
 
642
  def create_pretrained(f='weights/best.pt', s='weights/pretrained.pt'): # from utils.utils import *; create_pretrained()
 
651
  for p in x['model'].parameters():
652
  p.requires_grad = True
653
  torch.save(x, s)
654
+ print('%s saved as pretrained checkpoint %s, %.1fMB' % (f, s, os.path.getsize(s) / 1E6))
655
 
656
 
657
  def coco_class_count(path='../coco/labels/train2014/'):