Skip to content

Commit

Permalink
W&B: Login only in master processes (ultralytics#4866)
Browse files Browse the repository at this point in the history
* evolve fix

* Enable login timeout

* fix pkg

* check rank

* don't relogin
  • Loading branch information
AyushExel authored and CesarBazanAV committed Sep 29, 2021
1 parent a59580f commit fcad974
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/loggers/wandb/wandb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
from utils.datasets import img2label_paths
from utils.general import check_dataset, check_file

RANK = int(os.getenv('RANK', -1))

try:
import wandb

assert hasattr(wandb, '__version__') # verify package import not local dir
if pkg.parse_version(wandb.__version__) >= pkg.parse_version('0.12.2'):
if pkg.parse_version(wandb.__version__) >= pkg.parse_version('0.12.2') and RANK in [0, -1]:
wandb.login(timeout=30)
except (ImportError, AssertionError):
wandb = None

RANK = int(os.getenv('RANK', -1))
WANDB_ARTIFACT_PREFIX = 'wandb-artifact://'


Expand Down

0 comments on commit fcad974

Please sign in to comment.