Kaggle LOGGER fix (#6041)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-12-20 17:30:46 +01:00
1 parent 26f0415287
commit 0db9d5b6a2
1 file changed
+2
+2
View File
@@ -46,6 +46,8 @@ os.environ['NUMEXPR_MAX_THREADS'] = str(NUM_THREADS) # NumExpr max threads
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)