From 0db9d5b6a217e3603622884b906dcd4c8008685c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 20 Dec 2021 17:30:46 +0100 Subject: [PATCH] Kaggle `LOGGER` fix (#6041) --- utils/general.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/general.py b/utils/general.py index 7ff397fb4caa..e63ac3e20b62 100755 --- a/utils/general.py +++ b/utils/general.py @@ -46,6 +46,8 @@ def set_logging(name=None, verbose=True): # Sets level and returns logger + for h in logging.root.handlers[:]: + logging.root.removeHandler(h) # remove all handlers associated with the root logger object rank = int(os.getenv('RANK', -1)) # rank in world for Multi-GPU trainings logging.basicConfig(format="%(message)s", level=logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING) return logging.getLogger(name)