Policy Inference
1. Policy Inference
Run inference using a trained policy model and automatically record the results:
/isaac-sim/python.sh src/lerobot/scripts/lerobot_record.py \
--robot.type=walker_s2_sim \
--robot.headless=false \
--task=Part_Sorting \
--policy.path=your_checkpoint_dir \
--dataset.repo_id=your_org/eval_Part_Sorting \
--dataset.single_task="Part Sorting" \
--dataset.num_episodes=2 \
--dataset.push_to_hub=false \
--dataset.episode_time_s=100000000 \
--dataset.num_image_writer_processes=4 \
--dataset.root=${workspaceFolder}/datasets/Part_Sorting/your_policy_type \
--dataset.video=true \
--play_sounds=false
| Parameter | Description | Default / Notes |
|---|---|---|
--robot.type | Robot type | walker_s2_sim |
--robot.headless | Whether to run in headless mode | false |
--task | Task name (Part_Sorting, Conveyor_Sorting, Foam_Inlaying, or Packing_Box) | Foam_Inlaying |
--policy.path | Path to the policy model checkpoint, either a local path or a Hugging Face Hub repository | Required |
--dataset.repo_id | Dataset identifier. In inference mode, it should follow the xx/eval_xx format | Required |
--dataset.single_task | Task description | Required unless automatically set based on --task |
--dataset.num_episodes | Number of inference episodes | 50 |
--dataset.root | Directory where the inference results are saved | Required |
--dataset.video | Whether to record videos | true |
--dataset.fps | Recording frame rate | 30 |
--dataset.episode_time_s | Duration of each episode, in seconds | 60 |
--dataset.push_to_hub | Whether to upload the dataset to the Hugging Face Hub | false |
--play_sounds | Whether to play audio prompts | true |
Notes:
- Policy inference is performed using the
lerobot_record.pyscript. Specify the policy model checkpoint using the--policy.pathparameter. The script automatically loads the model, runs inference in the simulation environment, and records the results. - In inference mode, the
--dataset.repo_idparameter should follow thexx/eval_xxformat, such asyour_org/eval_Part_Sorting, to distinguish evaluation datasets from datasets created in data collection mode. - Replace
${workspaceFolder}with the actual path to your workspace.