Check TensorBoard logger before adding graph (#8664)

Otherwise, an error is thrown if the tensorboard logger is not included.
pull/8668/head
Rüdiger Busche 2022-07-21 17:40:53 +02:00 committed by GitHub
parent 92e47b85d9
commit 602d7ffb0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class Loggers():
# Callback runs on train batch end
if plots:
if ni == 0:
if not self.opt.sync_bn: # --sync known issue https://github.com/ultralytics/yolov5/issues/3754
if self.tb and not self.opt.sync_bn: # --sync known issue https://github.com/ultralytics/yolov5/issues/3754
with warnings.catch_warnings():
warnings.simplefilter('ignore') # suppress jit trace warning
self.tb.add_graph(torch.jit.trace(de_parallel(model), imgs[0:1], strict=False), [])