Rüdiger Busche
commited on
Check TensorBoard logger before adding graph (#8664)
Browse filesOtherwise, an error is thrown if the tensorboard logger is not included.
utils/loggers/__init__.py
CHANGED
@@ -102,7 +102,7 @@ class Loggers():
|
|
102 |
# Callback runs on train batch end
|
103 |
if plots:
|
104 |
if ni == 0:
|
105 |
-
if not self.opt.sync_bn: # --sync known issue https://github.com/ultralytics/yolov5/issues/3754
|
106 |
with warnings.catch_warnings():
|
107 |
warnings.simplefilter('ignore') # suppress jit trace warning
|
108 |
self.tb.add_graph(torch.jit.trace(de_parallel(model), imgs[0:1], strict=False), [])
|
|
|
102 |
# Callback runs on train batch end
|
103 |
if plots:
|
104 |
if ni == 0:
|
105 |
+
if self.tb and not self.opt.sync_bn: # --sync known issue https://github.com/ultralytics/yolov5/issues/3754
|
106 |
with warnings.catch_warnings():
|
107 |
warnings.simplefilter('ignore') # suppress jit trace warning
|
108 |
self.tb.add_graph(torch.jit.trace(de_parallel(model), imgs[0:1], strict=False), [])
|