|
|
|
|
|
|
|
|
Logging utils |
|
|
Logging utils |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
import os |
|
|
import warnings |
|
|
import warnings |
|
|
from threading import Thread |
|
|
from threading import Thread |
|
|
|
|
|
|
|
|
|
|
|
import pkg_resources as pkg |
|
|
import torch |
|
|
import torch |
|
|
from torch.utils.tensorboard import SummaryWriter |
|
|
from torch.utils.tensorboard import SummaryWriter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from utils.torch_utils import de_parallel |
|
|
from utils.torch_utils import de_parallel |
|
|
|
|
|
|
|
|
LOGGERS = ('csv', 'tb', 'wandb') # text-file, TensorBoard, Weights & Biases |
|
|
LOGGERS = ('csv', 'tb', 'wandb') # text-file, TensorBoard, Weights & Biases |
|
|
|
|
|
RANK = int(os.getenv('RANK', -1)) |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
import wandb |
|
|
import wandb |
|
|
|
|
|
|
|
|
assert hasattr(wandb, '__version__') # verify package import not local dir |
|
|
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) |
|
|
|
|
|
if not wandb_login_success: |
|
|
|
|
|
wandb = None |
|
|
except (ImportError, AssertionError): |
|
|
except (ImportError, AssertionError): |
|
|
wandb = None |
|
|
wandb = None |
|
|
|
|
|
|