From c170d5b392688092c7bbd6981658586b71ceb5ae Mon Sep 17 00:00:00 2001 From: Alexander Swerdlow Date: Tue, 2 Dec 2025 15:54:57 -0800 Subject: [PATCH] Add warning message when NoOpWeightLoader is used --- scripts/train_pytorch.py | 2 ++ src/openpi/training/weight_loaders.py | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/train_pytorch.py b/scripts/train_pytorch.py index c7ddd2b595..483333c734 100644 --- a/scripts/train_pytorch.py +++ b/scripts/train_pytorch.py @@ -447,6 +447,8 @@ def train_loop(config: _config.TrainConfig): (model.module if isinstance(model, torch.nn.parallel.DistributedDataParallel) else model), model_path ) logging.info(f"Loaded PyTorch weights from {config.pytorch_weight_path}") + else: + logging.warning("No weights loaded, training from scratch.") # Optimizer + learning rate schedule from config warmup_steps = config.lr_schedule.warmup_steps diff --git a/src/openpi/training/weight_loaders.py b/src/openpi/training/weight_loaders.py index 0eee1c61d4..03db4ea28b 100644 --- a/src/openpi/training/weight_loaders.py +++ b/src/openpi/training/weight_loaders.py @@ -31,6 +31,7 @@ def load(self, params: at.Params) -> at.Params: @dataclasses.dataclass(frozen=True) class NoOpWeightLoader(WeightLoader): def load(self, params: at.Params) -> at.Params: + logger.warning("No weights loaded, training from scratch.") return params