forked from tangger/lerobot
skipping keys containing lists, bc the robot gives nothing but tensors
This commit is contained in:
@@ -109,6 +109,9 @@ def predict_action(observation, policy, device, use_amp):
|
|||||||
):
|
):
|
||||||
# Convert to pytorch format: channel first and float32 in [0,1] with batch dimension
|
# Convert to pytorch format: channel first and float32 in [0,1] with batch dimension
|
||||||
for name in observation:
|
for name in observation:
|
||||||
|
if isinstance(observation[name], list):
|
||||||
|
continue # VLA-like and multirobot policies include textual inputs in the observation
|
||||||
|
|
||||||
if "image" in name:
|
if "image" in name:
|
||||||
observation[name] = observation[name].type(torch.float32) / 255
|
observation[name] = observation[name].type(torch.float32) / 255
|
||||||
observation[name] = observation[name].permute(2, 0, 1).contiguous()
|
observation[name] = observation[name].permute(2, 0, 1).contiguous()
|
||||||
|
|||||||
Reference in New Issue
Block a user