added wandb.run_id to allow resuming without wandb log; updated log m… (#841)
Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
This commit is contained in:
parent
7dc9ffe4c9
commit
a3cd18eda9
|
@ -69,7 +69,13 @@ class WandBLogger:
|
||||||
os.environ["WANDB_SILENT"] = "True"
|
os.environ["WANDB_SILENT"] = "True"
|
||||||
import wandb
|
import wandb
|
||||||
|
|
||||||
wandb_run_id = get_wandb_run_id_from_filesystem(self.log_dir) if cfg.resume else None
|
wandb_run_id = (
|
||||||
|
cfg.wandb.run_id
|
||||||
|
if cfg.wandb.run_id
|
||||||
|
else get_wandb_run_id_from_filesystem(self.log_dir)
|
||||||
|
if cfg.resume
|
||||||
|
else None
|
||||||
|
)
|
||||||
wandb.init(
|
wandb.init(
|
||||||
id=wandb_run_id,
|
id=wandb_run_id,
|
||||||
project=self.cfg.project,
|
project=self.cfg.project,
|
||||||
|
|
|
@ -46,6 +46,7 @@ class WandBConfig:
|
||||||
project: str = "lerobot"
|
project: str = "lerobot"
|
||||||
entity: str | None = None
|
entity: str | None = None
|
||||||
notes: str | None = None
|
notes: str | None = None
|
||||||
|
run_id: str | None = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
|
@ -79,7 +79,9 @@ class TrainPipelineConfig(HubMixin):
|
||||||
# The entire train config is already loaded, we just need to get the checkpoint dir
|
# The entire train config is already loaded, we just need to get the checkpoint dir
|
||||||
config_path = parser.parse_arg("config_path")
|
config_path = parser.parse_arg("config_path")
|
||||||
if not config_path:
|
if not config_path:
|
||||||
raise ValueError("A config_path is expected when resuming a run.")
|
raise ValueError(
|
||||||
|
f"A config_path is expected when resuming a run. Please specify path to {TRAIN_CONFIG_NAME}"
|
||||||
|
)
|
||||||
if not Path(config_path).resolve().exists():
|
if not Path(config_path).resolve().exists():
|
||||||
raise NotADirectoryError(
|
raise NotADirectoryError(
|
||||||
f"{config_path=} is expected to be a local path. "
|
f"{config_path=} is expected to be a local path. "
|
||||||
|
|
Loading…
Reference in New Issue