Skip to content

Commit 602d7ff

Browse files
authored
Check TensorBoard logger before adding graph (#8664)
Otherwise, an error is thrown if the tensorboard logger is not included.
1 parent 92e47b8 commit 602d7ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/loggers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def on_train_batch_end(self, ni, model, imgs, targets, paths, plots):
102102
# Callback runs on train batch end
103103
if plots:
104104
if ni == 0:
105-
if not self.opt.sync_bn: # --sync known issue https://github.com/ultralytics/yolov5/issues/3754
105+
if self.tb and not self.opt.sync_bn: # --sync known issue https://github.com/ultralytics/yolov5/issues/3754
106106
with warnings.catch_warnings():
107107
warnings.simplefilter('ignore') # suppress jit trace warning
108108
self.tb.add_graph(torch.jit.trace(de_parallel(model), imgs[0:1], strict=False), [])

0 commit comments

Comments
 (0)