From 9e11fc691bf47f215d26e7eae08aa8761c942d38 Mon Sep 17 00:00:00 2001 From: Sebastian Hoffmann Date: Sat, 18 Nov 2023 15:18:22 +0100 Subject: [PATCH] fix: double printing when training multiple times --- dmlcloud/training/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dmlcloud/training/util.py b/dmlcloud/training/util.py index f4e36c2..6fc4006 100644 --- a/dmlcloud/training/util.py +++ b/dmlcloud/training/util.py @@ -15,6 +15,9 @@ def setup_logging(): root_logger = logging.getLogger() root_logger.setLevel(logging.INFO if hvd.rank() == 0 else logging.WARNING) + if root_logger.hasHandlers(): + return + stdout_handler = logging.StreamHandler(sys.stdout) stdout_handler.setLevel(logging.DEBUG) stdout_handler.setFormatter(logging.Formatter())