Handle non-TTY `wandb.errors.UsageError` (#5839)
Browse files* `try: except (..., wandb.errors.UsageError)`
* bug fix
utils/loggers/__init__.py
CHANGED
@@ -24,7 +24,10 @@ try:
|
|
24 |
|
25 |
assert hasattr(wandb, '__version__') # verify package import not local dir
|
26 |
if pkg.parse_version(wandb.__version__) >= pkg.parse_version('0.12.2') and RANK in [0, -1]:
|
27 |
-
|
|
|
|
|
|
|
28 |
if not wandb_login_success:
|
29 |
wandb = None
|
30 |
except (ImportError, AssertionError):
|
|
|
24 |
|
25 |
assert hasattr(wandb, '__version__') # verify package import not local dir
|
26 |
if pkg.parse_version(wandb.__version__) >= pkg.parse_version('0.12.2') and RANK in [0, -1]:
|
27 |
+
try:
|
28 |
+
wandb_login_success = wandb.login(timeout=30)
|
29 |
+
except wandb.errors.UsageError: # known non-TTY terminal issue
|
30 |
+
wandb_login_success = False
|
31 |
if not wandb_login_success:
|
32 |
wandb = None
|
33 |
except (ImportError, AssertionError):
|