Skip to content

Commit

Permalink
fix(logger): missing attribute when using colab (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
FateScript committed Jul 20, 2022
1 parent 57b4cc7 commit a5bb5ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions yolox/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def write(self, buf):
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)
Expand Down

0 comments on commit a5bb5ab

Please sign in to comment.