removed xy/wh loss reporting

This commit is contained in:
Glenn Jocher
2019-08-24 20:55:01 +02:00
parent 25a579e417
commit 790e25592f
3 changed files with 40 additions and 21 deletions
+15 -8
View File
@@ -562,20 +562,27 @@ def print_model_biases(model):
'classification: %.2f+/-%.2f' % (b[:, 5:].mean(), b[:, 5:].std()))
def strip_optimizer(f='weights/best.pt'): # from utils.utils import *; strip_optimizer()
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)
x['optimizer'] = None
# x['training_results'] = None
# x['epoch'] = -1
# for p in x['model'].values():
# try:
# p.requires_grad = True
# except:
# pass
torch.save(x, f)
def create_backbone(f='weights/last.pt'): # from utils.utils import *; create_backbone()
# create a backbone from a *.pt file
x = torch.load(f)
x['optimizer'] = None
x['training_results'] = None
x['epoch'] = -1
for p in x['model'].values():
try:
p.requires_grad = True
except:
pass
torch.save(x, 'weights/backbone.pt')
def coco_class_count(path='../coco/labels/train2014/'):
# Histogram of occurrences per class
nc = 80 # number classes