TensorBoard add_graph() fix (#3236)
parent
3f74cd9ed1
commit
b7cd1f540d
6
train.py
6
train.py
|
@ -330,9 +330,9 @@ def train(hyp, opt, device, tb_writer=None):
|
|||
if plots and ni < 3:
|
||||
f = save_dir / f'train_batch{ni}.jpg' # filename
|
||||
Thread(target=plot_images, args=(imgs, targets, paths, f), daemon=True).start()
|
||||
# if tb_writer:
|
||||
# tb_writer.add_image(f, result, dataformats='HWC', global_step=epoch)
|
||||
# tb_writer.add_graph(torch.jit.trace(model, imgs, strict=False), []) # add model graph
|
||||
if tb_writer:
|
||||
tb_writer.add_graph(torch.jit.trace(model, imgs, strict=False), []) # add model graph
|
||||
# tb_writer.add_image(f, result, dataformats='HWC', global_step=epoch)
|
||||
elif plots and ni == 10 and wandb_logger.wandb:
|
||||
wandb_logger.log({"Mosaics": [wandb_logger.wandb.Image(str(x), caption=x.name) for x in
|
||||
save_dir.glob('train*.jpg') if x.exists()]})
|
||||
|
|
Loading…
Reference in New Issue