Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2019-09-04 14:32:42 +02:00
parent 2e6ac2228a
commit abbf8de12f
1 changed files with 5 additions and 1 deletions

View File

@ -556,7 +556,11 @@ def get_yolo_layers(model):
def print_model_biases(model): def print_model_biases(model):
# prints the bias neurons preceding each yolo layer # prints the bias neurons preceding each yolo layer
print('\nModel Bias Summary (per output layer):') print('\nModel Bias Summary (per output layer):')
multi_gpu = type(model) in (nn.parallel.DataParallel, nn.parallel.DistributedDataParallel)
for l in model.yolo_layers: # print pretrained biases for l in model.yolo_layers: # print pretrained biases
if multi_gpu:
b = model.module.module_list[l - 1][0].bias.view(3, -1) # bias 3x85
else:
b = model.module_list[l - 1][0].bias.view(3, -1) # bias 3x85 b = model.module_list[l - 1][0].bias.view(3, -1) # bias 3x85
print('regression: %5.2f+/-%-5.2f ' % (b[:, :4].mean(), b[:, :4].std()), print('regression: %5.2f+/-%-5.2f ' % (b[:, :4].mean(), b[:, :4].std()),
'objectness: %5.2f+/-%-5.2f ' % (b[:, 4].mean(), b[:, 4].std()), 'objectness: %5.2f+/-%-5.2f ' % (b[:, 4].mean(), b[:, 4].std()),