updates
This commit is contained in:
parent
11aac8930b
commit
858fc67954
|
@ -552,6 +552,15 @@ def get_yolo_layers(model):
|
|||
return [i for i, x in enumerate(bool_vec) if x] # [82, 94, 106] for yolov3
|
||||
|
||||
|
||||
def print_model_biases(model):
|
||||
# prints the bias neurons preceding each yolo layer
|
||||
for l in model.yolo_layers: # print pretrained biases
|
||||
b = model.module_list[l - 1][0].bias.view(3, -1) # bias 3x85
|
||||
print('regression: %.2f+/-%.2f, ' % (b[:, :4].mean(), b[:, :4].std()),
|
||||
'objectness: %.2f+/-%.2f, ' % (b[:, 4].mean(), b[:, 4].std()),
|
||||
'classification: %.2f+/-%.2f' % (b[:, 5:].mean(), b[:, 5:].std()))
|
||||
|
||||
|
||||
def strip_optimizer_from_checkpoint(filename='weights/best.pt'):
|
||||
# Strip optimizer from *.pt files for lighter files (reduced by 2/3 size)
|
||||
a = torch.load(filename, map_location='cpu')
|
||||
|
|
Loading…
Reference in New Issue