Configure wandb entity outside config

This commit is contained in:
Simon Alibert
2024-03-11 13:09:46 +01:00
parent d4ea4f0ad1
commit 00fe4f4f18
3 changed files with 10 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ class Logger:
project = cfg.get("wandb", {}).get("project")
entity = cfg.get("wandb", {}).get("entity")
enable_wandb = cfg.get("wandb", {}).get("enable", False)
run_offline = not enable_wandb or not project or not entity
run_offline = not enable_wandb or not project
if run_offline:
logging.info(colored("Logs will be saved locally.", "yellow", attrs=["bold"]))
self._wandb = None
@@ -63,6 +63,7 @@ class Logger:
resume=None,
)
print(colored("Logs will be synced with wandb.", "blue", attrs=["bold"]))
logging.info(f"Track this run --> {colored(wandb.run.get_url(), 'yellow', attrs=['bold'])}")
self._wandb = wandb
def save_model(self, policy, identifier):