Browse Source

Simplify `set_logging()` indexing (#6042)

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

+ 1
- 1
utils/general.py View File



def set_logging(name=None, verbose=True): def set_logging(name=None, verbose=True):
# Sets level and returns logger # Sets level and returns logger
for h in logging.root.handlers[:]:
for h in logging.root.handlers:
logging.root.removeHandler(h) # remove all handlers associated with the root logger object 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 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) logging.basicConfig(format="%(message)s", level=logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING)

Loading…
Cancel
Save