Skip to content

Commit a5bb5ab

Browse files
authored
fix(logger): missing attribute when using colab (Megvii-BaseDetection#1443)
1 parent 57b4cc7 commit a5bb5ab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

yolox/utils/logger.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ def write(self, buf):
6060
def flush(self):
6161
pass
6262

63+
def isatty(self):
64+
# when using colab, jax is installed by default and issue like
65+
# https://github.com/Megvii-BaseDetection/YOLOX/issues/1437 might be raised
66+
# due to missing attribute like`isatty`.
67+
# For more details, checked the following link:
68+
# https://github.com/google/jax/blob/10720258ea7fb5bde997dfa2f3f71135ab7a6733/jax/_src/pretty_printer.py#L54 # noqa
69+
return True
70+
6371

6472
def redirect_sys_output(log_level="INFO"):
6573
redirect_logger = StreamToLoguru(log_level)

0 commit comments

Comments
 (0)