Browse Source

Kaggle `LOGGER` fix (#6041)

modifyDataloader
Glenn Jocher GitHub 2 years ago
parent
commit
0db9d5b6a2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      utils/general.py

+ 2
- 0
utils/general.py 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)

Loading…
Cancel
Save