tensorboard updates
This commit is contained in:
parent
00c1fdd805
commit
41246aa042
12
train.py
12
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]
|
||||
|
|
Loading…
Reference in New Issue