未验证 提交 a5bb5ab1 编写于 作者: F Feng Wang 提交者: GitHub

fix(logger): missing attribute when using colab (#1443)

上级 57b4cc7e
......@@ -60,6 +60,14 @@ class StreamToLoguru:
def flush(self):
pass
def isatty(self):
# when using colab, jax is installed by default and issue like
# https://github.com/Megvii-BaseDetection/YOLOX/issues/1437 might be raised
# due to missing attribute like`isatty`.
# For more details, checked the following link:
# https://github.com/google/jax/blob/10720258ea7fb5bde997dfa2f3f71135ab7a6733/jax/_src/pretty_printer.py#L54 # noqa
return True
def redirect_sys_output(log_level="INFO"):
redirect_logger = StreamToLoguru(log_level)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册