Skip to main content

Policy Inference


1. Policy Inference

Run inference with 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
ArgumentDescriptionDefault / Notes
--robot.typeRobot typewalker_s2_sim
--robot.headlessWhether to run in headless modefalse
--taskTask name (Part_Sorting, Conveyor_Sorting, Foam_Inlaying, Packing_Box)Foam_Inlaying
--policy.pathPolicy checkpoint path (local or Hugging Face)Required
--dataset.repo_idDataset identifier; in inference it should follow xx/eval_xxRequired
--dataset.single_taskTask descriptionRequired (or auto-set by task)
--dataset.num_episodesNumber of inference episodes50
--dataset.rootOutput path for inference resultsRequired
--dataset.videoWhether to record videotrue
--dataset.fpsFPS30
--dataset.episode_time_sEpisode duration (seconds)60
--dataset.push_to_hubUpload to Hugging Facefalse
--play_soundsPlay audio promptstrue

Notes:

  1. Policy inference uses the lerobot_record.py script. Specify the policy model path via --policy.path. The script will load the model, run inference in the simulation environment, and record the resulting data automatically.
  2. In inference mode, --dataset.repo_id should use the xx/eval_xx format (e.g., your_org/eval_Part_Sorting) to distinguish it from dataset naming in data-collection mode.
  3. Replace ${workspaceFolder} with your actual working directory path.