From a7541b6d8d336301f2d92107c9e332d6fafb9acb Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 23 Jul 2020 09:14:01 -0600 Subject: [PATCH] Fix illegal tb_logger use in distributed training --- codes/train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codes/train.py b/codes/train.py index ca12db0f..98fcfa2c 100644 --- a/codes/train.py +++ b/codes/train.py @@ -203,7 +203,8 @@ def main(): message += ')] ' for k, v in logs.items(): if 'histogram' in k: - tb_logger.add_histogram(k, v, current_step) + if rank <= 0: + tb_logger.add_histogram(k, v, current_step) else: message += '{:s}: {:.4e} '.format(k, v) # tensorboard logger