瀏覽代碼

Simplify `set_logging()` indexing (#6042)

modifyDataloader
Glenn Jocher GitHub 2 年之前
父節點
當前提交
b8a4babd60
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      utils/general.py

+ 1
- 1
utils/general.py 查看文件

@@ -46,7 +46,7 @@ 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[:]:
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)

Loading…
取消
儲存