From 97aa07407929c9ada6c60e988c89f6fe9b440a61 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 21 Jun 2022 17:41:14 +0200 Subject: [PATCH] `logging.ERROR` on `RANK` not in (0, 1) (#8284) Improve DDP console response in https://github.com/ultralytics/yolov5/issues/8283 --- utils/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index 9fc7349dbb6d..a3e242d78a17 100755 --- a/utils/general.py +++ b/utils/general.py @@ -85,7 +85,7 @@ def set_logging(name=None, verbose=VERBOSE): 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 - level = logging.INFO if verbose and rank in {-1, 0} else logging.WARNING + level = logging.INFO if verbose and rank in {-1, 0} else logging.ERROR log = logging.getLogger(name) log.setLevel(level) handler = logging.StreamHandler()