From 4bd451b1e5a1f619d9fe6c48ca754b0124110942 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 14 Jan 2021 13:16:48 -0800 Subject: [PATCH] Daemon thread mosaic plots fix (#1943) --- train.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 9aff01a42c08..f0ad206d4b94 100644 --- a/train.py +++ b/train.py @@ -318,8 +318,9 @@ def train(hyp, opt, device, tb_writer=None, wandb=None): # if tb_writer: # tb_writer.add_image(f, result, dataformats='HWC', global_step=epoch) # tb_writer.add_graph(model, imgs) # add model to tensorboard - elif plots and ni == 3 and wandb: - wandb.log({"Mosaics": [wandb.Image(str(x), caption=x.name) for x in save_dir.glob('train*.jpg')]}) + elif plots and ni > 3 and wandb: + wandb.log({"Mosaics": [wandb.Image(str(x), caption=x.name) for x in save_dir.glob('train*.jpg') + if x.exists()]}) # end batch ------------------------------------------------------------------------------------------------ # end epoch ----------------------------------------------------------------------------------------------------