Feng Wang
commited on
Commit
·
583f89f
1
Parent(s):
be88154
fix(logger): missing attribute when using colab (#1443)
Browse files- yolox/utils/logger.py +8 -0
yolox/utils/logger.py
CHANGED
@@ -60,6 +60,14 @@ class StreamToLoguru:
|
|
60 |
def flush(self):
|
61 |
pass
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
def redirect_sys_output(log_level="INFO"):
|
65 |
redirect_logger = StreamToLoguru(log_level)
|
|
|
60 |
def flush(self):
|
61 |
pass
|
62 |
|
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 |
+
|
71 |
|
72 |
def redirect_sys_output(log_level="INFO"):
|
73 |
redirect_logger = StreamToLoguru(log_level)
|