An
ACT (Action Chunking Transformer) policy trained with
LeRobot on a
single LIBERO-Goal task:
put the bowl on the plate (task suite
libero_goal,
task_id = 8).
This checkpoint was produced as a teaching demo for a robot-learning course: it is small
(51.7M parameters), trains in minutes on one GPU, and is meant as a clean, reproducible
reference point for "what a working single-task imitation policy looks like".
Requires
LeRobot with the LIBERO environment
(
lerobot[libero]). Closed-loop rollout in simulation:
1import torch
2from lerobot.configs.policies import PreTrainedConfig
3from lerobot.envs.configs import LiberoEnv as LiberoEnvConfig
4from lerobot.envs.factory import make_env, make_env_pre_post_processors
5from lerobot.envs.utils import add_envs_task, preprocess_observation
6from lerobot.policies.factory import get_policy_class, make_pre_post_processors
7import lerobot.policies # register policy types
8
9policy_path = "Harrysunshine/act-libero-goal"
10task_suite = "libero_goal"
11task_id = 8 # "put the bowl on the plate"
12device = "cuda"
13
14policy_cfg = PreTrainedConfig.from_pretrained(policy_path)
15policy_cfg.device = device
16policy = get_policy_class(policy_cfg.type).from_pretrained(
17 policy_path, config=policy_cfg, strict=False
18)
19preprocessor, postprocessor = make_pre_post_processors(
20 policy_cfg, pretrained_path=policy_path
21)
22
23env_cfg = LiberoEnvConfig(
24 task=task_suite,
25 task_ids=[task_id],
26 obs_type="pixels_agent_pos",
27 observation_height=256,
28 observation_width=256,
29 episode_length=300,
30)
31env = make_env(env_cfg, n_envs=1)[task_suite][task_id]
32env_preprocessor, env_postprocessor = make_env_pre_post_processors(env_cfg, policy_cfg)
33
34policy.reset()
35observation, _ = env.reset(seed=[7])
36for _ in range(300):
37 batch = preprocess_observation(observation)
38 batch = add_envs_task(env, batch)
39 batch = env_preprocessor(batch)
40 batch = preprocessor(batch)
41 with torch.inference_mode():
42 action = policy.select_action(batch)
43 action = postprocessor(action)
44 action = env_postprocessor(action)
45 observation, _, terminated, truncated, info = env.step(action.cpu().numpy())
46 if terminated[0] or truncated[0]:
47 break
1@inproceedings{zhao2023act,
2 title = {Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware},
3 author = {Zhao, Tony Z. and Kumar, Vikash and Levine, Sergey and Finn, Chelsea},
4 booktitle = {Robotics: Science and Systems (RSS)},
5 year = {2023}
6}
1@inproceedings{liu2023libero,
2 title = {LIBERO: Benchmarking Knowledge Transfer for Lifelong Robot Learning},
3 author = {Liu, Bo and Zhu, Yifeng and Gao, Chongkai and Feng, Yihao and Liu, Qiang and Zhu, Yuke and Stone, Peter},
4 booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
5 year = {2023}
6}
这是一个用
LeRobot 训练的
ACT(动作分块 Transformer)
策略,任务是 LIBERO-Goal 套件中的第 8 个任务
“把碗放到盘子上”(
put the bowl on the plate)。