-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
bugSomething isn’t working correctlySomething isn’t working correctly
Description
When run the code python3 ./examples/3_train_policy.py, the following error is reported:
Traceback (most recent call last):
File "./lerobot/examples/3_train_policy.py", line 121, in <module>
main()
File "./lerobot/examples/3_train_policy.py", line 102, in main
batch = {k: v.to(device, non_blocking=True) for k, v in batch.items()}
File "/data/code/lerobot/examples/3_train_policy.py", line 102, in <dictcomp>
batch = {k: v.to(device, non_blocking=True) for k, v in batch.items()}
AttributeError: 'list' object has no attribute 'to'
Because the data type of batch['task'] is list, such as:
['Push the T-shaped block onto the T-shaped target.',
'Push the T-shaped block onto the T-shaped target.',
'Push the T-shaped block onto the T-shaped target.',
'Push the T-shaped block onto the T-shaped target.',
'Push the T-shaped block onto the T-shaped target.',
'Push the T-shaped block onto the T-shaped target.',
'Push the T-shaped block onto the T-shaped target.',
...
]
Maybe the code should be:
batch = {k: (v.to(device, non_blocking=True) if isinstance(v, torch.Tensor) else v) for k, v in batch.items()}
xrlexpert, brysonjones, iserverobotics-bona, BaldPulse, FujikawaYouta and 4 more
Metadata
Metadata
Assignees
Labels
bugSomething isn’t working correctlySomething isn’t working correctly