From b536f47e3ff8c3b340fc5efa52f0ece0a7212a57 Mon Sep 17 00:00:00 2001 From: Ben Zhang <5977478+ben-z@users.noreply.github.com> Date: Thu, 5 Jun 2025 02:13:03 -0700 Subject: [PATCH] Fix SmolVLA loss not sent to wandb (#1198) --- lerobot/common/policies/smolvla/modeling_smolvla.py | 2 +- lerobot/common/utils/wandb_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lerobot/common/policies/smolvla/modeling_smolvla.py b/lerobot/common/policies/smolvla/modeling_smolvla.py index efdf602d..008ba838 100644 --- a/lerobot/common/policies/smolvla/modeling_smolvla.py +++ b/lerobot/common/policies/smolvla/modeling_smolvla.py @@ -338,7 +338,7 @@ class SmolVLAPolicy(PreTrainedPolicy): # For backward pass loss = losses.mean() # For backward pass - loss_dict["loss"] = loss + loss_dict["loss"] = loss.item() return loss, loss_dict def prepare_images(self, batch): diff --git a/lerobot/common/utils/wandb_utils.py b/lerobot/common/utils/wandb_utils.py index 3fe241d4..9e938e19 100644 --- a/lerobot/common/utils/wandb_utils.py +++ b/lerobot/common/utils/wandb_utils.py @@ -115,7 +115,7 @@ class WandBLogger: for k, v in d.items(): if not isinstance(v, (int, float, str)): logging.warning( - f'WandB logging of key "{k}" was ignored as its type is not handled by this wrapper.' + f'WandB logging of key "{k}" was ignored as its type "{type(v)}" is not handled by this wrapper.' ) continue self._wandb.log({f"{mode}/{k}": v}, step=step)