Skip to content

Commit

Permalink
Fixed eval.py on MPS (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
IliaLarchenko authored Feb 13, 2025
1 parent 1e49cc4 commit c574eb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lerobot/scripts/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def rollout(
if return_observations:
all_observations.append(deepcopy(observation))

observation = {key: observation[key].to(device, non_blocking=True) for key in observation}
observation = {
key: observation[key].to(device, non_blocking=device.type == "cuda") for key in observation
}

with torch.inference_mode():
action = policy.select_action(observation)
Expand Down

0 comments on commit c574eb4

Please sign in to comment.