W&B: fix DDP with wandb disabled (#5163)

* fix dpp with wandb disabled

* PyCharm reformat

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Ayush ChaurasiaandGlenn Jocher authored and GitHub committed 2021-10-13 16:17:15 -07:00
1 parent a346926996
commit d0bfeb3980
2 files changed
+7 -10

No files matched your search

-10
View File
@@ -20,16 +20,6 @@ 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') and RANK in [0, -1]:
wandb.login(timeout=30)
except (ImportError, AssertionError):
wandb = None
WANDB_ARTIFACT_PREFIX = 'wandb-artifact://'