Ayush Chaurasia
commited on
W&B: Login only in master processes (#4866)
Browse files* evolve fix
* Enable login timeout
* fix pkg
* check rank
* don't relogin
utils/loggers/wandb/wandb_utils.py
CHANGED
@@ -19,16 +19,17 @@ from utils.datasets import LoadImagesAndLabels
|
|
19 |
from utils.datasets import img2label_paths
|
20 |
from utils.general import check_dataset, check_file
|
21 |
|
|
|
|
|
22 |
try:
|
23 |
import wandb
|
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'):
|
27 |
wandb.login(timeout=30)
|
28 |
except (ImportError, AssertionError):
|
29 |
wandb = None
|
30 |
|
31 |
-
RANK = int(os.getenv('RANK', -1))
|
32 |
WANDB_ARTIFACT_PREFIX = 'wandb-artifact://'
|
33 |
|
34 |
|
|
|
19 |
from utils.datasets import img2label_paths
|
20 |
from utils.general import check_dataset, check_file
|
21 |
|
22 |
+
RANK = int(os.getenv('RANK', -1))
|
23 |
+
|
24 |
try:
|
25 |
import wandb
|
26 |
|
27 |
assert hasattr(wandb, '__version__') # verify package import not local dir
|
28 |
+
if pkg.parse_version(wandb.__version__) >= pkg.parse_version('0.12.2') and RANK in [0, -1]:
|
29 |
wandb.login(timeout=30)
|
30 |
except (ImportError, AssertionError):
|
31 |
wandb = None
|
32 |
|
|
|
33 |
WANDB_ARTIFACT_PREFIX = 'wandb-artifact://'
|
34 |
|
35 |
|