tensorboard updates

This commit is contained in:
Glenn Jocher 2020-04-04 19:34:39 -07:00
parent 00c1fdd805
commit 41246aa042
1 changed files with 6 additions and 6 deletions

View File

@ -284,7 +284,7 @@ def train():
plot_images(imgs=imgs, targets=targets, paths=paths, fname=f) plot_images(imgs=imgs, targets=targets, paths=paths, fname=f)
if tb_writer: if tb_writer:
tb_writer.add_image(f, cv2.imread(f)[:, :, ::-1], dataformats='HWC') tb_writer.add_image(f, cv2.imread(f)[:, :, ::-1], dataformats='HWC')
# tb_writer.add_graph(model, imgs) # tb_writer.add_graph(model, imgs) # add model to tensorboard
# end batch ------------------------------------------------------------------------------------------------ # end batch ------------------------------------------------------------------------------------------------
@ -313,11 +313,11 @@ def train():
# Write Tensorboard results # Write Tensorboard results
if tb_writer: if tb_writer:
x = list(mloss) + list(results) tags = ['train/giou_loss', 'train/obj_loss', 'train/cls_loss',
titles = ['GIoU', 'Objectness', 'Classification', 'Train loss', 'metrics/precision', 'metrics/recall', 'metrics/mAP_0.5', 'metrics/F1',
'Precision', 'Recall', 'mAP', 'F1', 'val GIoU', 'val Objectness', 'val Classification'] 'val/giou_loss', 'val/obj_loss', 'val/cls_loss']
for xi, title in zip(x, titles): for x, tag in zip(list(mloss[:-1]) + list(results), tags):
tb_writer.add_scalar(title, xi, epoch) tb_writer.add_scalar(tag, x, epoch)
# Update best mAP # Update best mAP
fi = fitness(np.array(results).reshape(1, -1)) # fitness_i = weighted combination of [P, R, mAP, F1] fi = fitness(np.array(results).reshape(1, -1)) # fitness_i = weighted combination of [P, R, mAP, F1]