Skip to content

Commit

Permalink
Kaggle LOGGER fix (ultralytics#6041)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Dec 20, 2021
1 parent 232b979 commit 3ba419e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3ba419e

Please sign in to comment.