This commit is contained in:
IrvingF7 2025-04-03 10:31:22 -07:00 committed by GitHub
commit 713eab7e3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions
lerobot/common/policies/pi0

View File

@ -330,8 +330,8 @@ class PI0Policy(PreTrainedPolicy):
# For backward pass
loss = losses.mean()
# For logging
loss_dict["l2_loss"] = loss.item()
# For logging. Use detach so won't create scalar to break graph when using torch.compile
loss_dict["l2_loss"] = loss.detach()
return loss, loss_dict