From 41246aa0427eccba5f617daed1224616fab0ffa3 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 4 Apr 2020 19:34:39 -0700 Subject: [PATCH] tensorboard updates --- train.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/train.py b/train.py index edb6d749..6a8bd176 100644 --- a/train.py +++ b/train.py @@ -284,7 +284,7 @@ def train(): plot_images(imgs=imgs, targets=targets, paths=paths, fname=f) if tb_writer: 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 ------------------------------------------------------------------------------------------------ @@ -313,11 +313,11 @@ def train(): # Write Tensorboard results if tb_writer: - x = list(mloss) + list(results) - titles = ['GIoU', 'Objectness', 'Classification', 'Train loss', - 'Precision', 'Recall', 'mAP', 'F1', 'val GIoU', 'val Objectness', 'val Classification'] - for xi, title in zip(x, titles): - tb_writer.add_scalar(title, xi, epoch) + tags = ['train/giou_loss', 'train/obj_loss', 'train/cls_loss', + 'metrics/precision', 'metrics/recall', 'metrics/mAP_0.5', 'metrics/F1', + 'val/giou_loss', 'val/obj_loss', 'val/cls_loss'] + for x, tag in zip(list(mloss[:-1]) + list(results), tags): + tb_writer.add_scalar(tag, x, epoch) # Update best mAP fi = fitness(np.array(results).reshape(1, -1)) # fitness_i = weighted combination of [P, R, mAP, F1]