From fc5cf3d84a33683bcb4c3c0491ef20d9ea4a2af1 Mon Sep 17 00:00:00 2001 From: AshisGhosh Date: Sat, 11 May 2024 23:13:12 -0700 Subject: [PATCH] Fixes issue #152 - error with creating wandb artifact (#172) Co-authored-by: Ashis Ghosh Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com> --- lerobot/common/logger.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lerobot/common/logger.py b/lerobot/common/logger.py index 7a3e6eac..ea8db050 100644 --- a/lerobot/common/logger.py +++ b/lerobot/common/logger.py @@ -82,9 +82,9 @@ class Logger: # Also save the full Hydra config for the env configuration. OmegaConf.save(self._cfg, save_dir / "config.yaml") if self._wandb and not self._disable_wandb_artifact: - # note wandb artifact does not accept ":" in its name + # note wandb artifact does not accept ":" or "/" in its name artifact = self._wandb.Artifact( - self._group.replace(":", "_") + "-" + str(self._seed) + "-" + str(identifier), + f"{self._group.replace(':', '_').replace('/', '_')}-{self._seed}-{identifier}", type="model", ) artifact.add_file(save_dir / SAFETENSORS_SINGLE_FILE) @@ -94,9 +94,10 @@ class Logger: self._buffer_dir.mkdir(parents=True, exist_ok=True) fp = self._buffer_dir / f"{str(identifier)}.pkl" buffer.save(fp) - if self._wandb: + if self._wandb and not self._disable_wandb_artifact: + # note wandb artifact does not accept ":" or "/" in its name artifact = self._wandb.Artifact( - self._group + "-" + str(self._seed) + "-" + str(identifier), + f"{self._group.replace(':', '_').replace('/', '_')}-{self._seed}-{identifier}", type="buffer", ) artifact.add_file(fp)