English Version:
Build Dataset, Train Model & Inference
返回目录:
在你的AhaRobot上位机上,使用如下命令以收集数据集:
# rm -rf /home/rosdev/.cache/huggingface/lerobot/lookas/astra_grab_floor_toys_extended # 如果你想重新开始收集数据集
# rm -rf /home/rosdev/.cache/huggingface/lerobot/lookas/astra_grab_floor_toys_extended/images # 如果你中途中断了数据收集
pushd non_ros_src/lerobot
python lerobot/scripts/control_robot.py --robot.type=astra_joint --control.type=record --control.single_task="Grab the toys on the floor and put them on the tabletop." --control.fps=30 --control.repo_id=lookas/astra_grab_floor_toys_extended --control.tags='["astra"]' --control.warmup_time_s=0 --control.episode_time_s=-1 --control.reset_time_s=-1 --control.num_episodes=50 --control.push_to_hub=true --control.resume=false --control.local_files_only=true --control.run_compute_stats=true
其中,--control.num_episodes=50控制收集的demo数量,--control.push_to_hub=false可以避免将收集到的数据推送到huggingface上,--control.resume=true以增加数据集,--control.run_compute_stats=false则将取消掉统计过程以加快数据收集速度。
收集完数据后,你可以使用rerun来查看数据集中的内容:
pushd non_ros_src/lerobot
python lerobot/scripts/visualize_dataset.py --repo-id lookas/astra_grab_floor_toys_extended --episode-index 51 --local-files-only 1
⚠️ 如果你在Docker中运行rerun发现出现了3D/显卡相关的错误,请在Docker外打开rerun
在你收集到的数据集上训练你的模型:duid
python lerobot/scripts/train.py --dataset.repo_id=lookas/astra_grab_floor_toys_extended --policy.type=act --output_dir=outputs/train/act_astra_grab_floor_toys_extended --job_name=act_astra_grab_floor_toys_extended --device=cuda --wandb.enable=true
使用如下命令来在真实世界中运行你的模型:
pushd non_ros_src/lerobot
# rm -rf /home/rosdev/.cache/huggingface/lerobot/lookas/eval_act_astra_grab_floor_toys_extended # 如果你重新开始任务
python lerobot/scripts/control_robot.py --robot.type=astra_joint --control.type=record --control.fps=30 --control.single_task="Grasp the toys on the floor and put them on the tabletop." --control.repo_id=lookas/eval_act_astra_grab_floor_toys_extended --control.num_episodes=1 --control.warmup_time_s=0 --control.episode_time_s=-1 --control.reset_time_s=-1 --control.push_to_hub=false --control.policy.path=outputs/train/act_astra_grab_floor_toys_extended/checkpoints/0040000/pretrained_model --control.run_compute_stats=false --control.display_cameras=false