Skip to main content

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
ParameterDescriptionDefault / Notes
--robot.typeRobot typewalker_s2_sim
--robot.headlessWhether to run in headless modefalse
--taskTask name (Part_Sorting, Conveyor_Sorting, Foam_Inlaying, or Packing_Box)Foam_Inlaying
--policy.pathPath to the policy model checkpoint, either a local path or a Hugging Face Hub repositoryRequired
--dataset.repo_idDataset identifier. In inference mode, it should follow the xx/eval_xx formatRequired
--dataset.single_taskTask descriptionRequired unless automatically set based on --task
--dataset.num_episodesNumber of inference episodes50
--dataset.rootDirectory where the inference results are savedRequired
--dataset.videoWhether to record videostrue
--dataset.fpsRecording frame rate30
--dataset.episode_time_sDuration of each episode, in seconds60
--dataset.push_to_hubWhether to upload the dataset to the Hugging Face Hubfalse
--play_soundsWhether to play audio promptstrue

Notes:

  1. Policy inference is performed using the lerobot_record.py script. Specify the policy model checkpoint using the --policy.path parameter. The script automatically loads the model, runs inference in the simulation environment, and records the results.
  2. In inference mode, the --dataset.repo_id parameter should follow the xx/eval_xx format, such as your_org/eval_Part_Sorting, to distinguish evaluation datasets from datasets created in data collection mode.
  3. Replace ${workspaceFolder} with the actual path to your workspace.