Skip to content

Commit

Permalink
Handle non-TTY wandb.errors.UsageError (#5839)
Browse files Browse the repository at this point in the history
* `try: except (..., wandb.errors.UsageError)`

* bug fix
  • Loading branch information
glenn-jocher committed Dec 1, 2021
1 parent a4207a2 commit bc48457
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@

assert hasattr(wandb, '__version__') # verify package import not local dir
if pkg.parse_version(wandb.__version__) >= pkg.parse_version('0.12.2') and RANK in [0, -1]:
wandb_login_success = wandb.login(timeout=30)
try:
wandb_login_success = wandb.login(timeout=30)
except wandb.errors.UsageError: # known non-TTY terminal issue
wandb_login_success = False
if not wandb_login_success:
wandb = None
except (ImportError, AssertionError):
Expand Down

0 comments on commit bc48457

Please sign in to comment.