glenn-jocher commited on
Commit
777032e
1 Parent(s): 3a56cac

Daemon thread mosaic plots fix (#1943)

Browse files
Files changed (1) hide show
  1. train.py +3 -2
train.py CHANGED
@@ -318,8 +318,9 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
318
  # if tb_writer:
319
  # tb_writer.add_image(f, result, dataformats='HWC', global_step=epoch)
320
  # tb_writer.add_graph(model, imgs) # add model to tensorboard
321
- elif plots and ni == 3 and wandb:
322
- wandb.log({"Mosaics": [wandb.Image(str(x), caption=x.name) for x in save_dir.glob('train*.jpg')]})
 
323
 
324
  # end batch ------------------------------------------------------------------------------------------------
325
  # end epoch ----------------------------------------------------------------------------------------------------
 
318
  # if tb_writer:
319
  # tb_writer.add_image(f, result, dataformats='HWC', global_step=epoch)
320
  # tb_writer.add_graph(model, imgs) # add model to tensorboard
321
+ elif plots and ni > 3 and wandb:
322
+ wandb.log({"Mosaics": [wandb.Image(str(x), caption=x.name) for x in save_dir.glob('train*.jpg')
323
+ if x.exists()]})
324
 
325
  # end batch ------------------------------------------------------------------------------------------------
326
  # end epoch ----------------------------------------------------------------------------------------------------