Skip to content

Add UR5 fine-tuning example#935

Open
enjoysport2022 wants to merge 1 commit into
Physical-Intelligence:mainfrom
enjoysport2022:feature/ur5-example
Open

Add UR5 fine-tuning example#935
enjoysport2022 wants to merge 1 commit into
Physical-Intelligence:mainfrom
enjoysport2022:feature/ur5-example

Conversation

@enjoysport2022

Copy link
Copy Markdown

This PR implements the UR5 fine-tuning example that was previously outlined in examples/ur5/README.md as pseudocode.

Changes

  • Add UR5Inputs and UR5Outputs transform classes in src/openpi/policies/ur5_policy.py, mapping UR5 observations (6 joints + 1 gripper, base and wrist cameras) to the format expected by pi0 / pi0-FAST / pi0.5
  • Add LeRobotUR5DataConfig and three ready-to-use training configs in src/openpi/training/config.py: pi0_ur5 (full fine-tune), pi0_ur5_low_mem_finetune (LoRA), pi0_fast_ur5
  • Add examples/ur5/convert_ur5_data_to_lerobot.py for converting raw UR5 recordings to LeRobot dataset format
  • Add unit tests covering state concatenation, image format conversion (float32 CHW → uint8 HWC), image masks, and action slicing
  • Rewrite examples/ur5/README.md with step-by-step usage instructions

Bug fixes in original README outline

  • create_base_config() was missing the required model_config argument
  • UR5Inputs constructor referenced a non-existent action_dim field (padding is handled by PadStatesAndActions in ModelTransformFactory)

- Add UR5Inputs and UR5Outputs transform classes in ur5_policy.py,
  mapping UR5 observations (6 joints + 1 gripper, base and wrist cameras)
  to the format expected by pi0/pi0-FAST/pi0.5 models
- Add LeRobotUR5DataConfig and three training configs in config.py:
  pi0_ur5 (full fine-tune), pi0_ur5_low_mem_finetune (LoRA),
  pi0_fast_ur5 (pi0-FAST fine-tune)
- Add convert_ur5_data_to_lerobot.py for converting raw UR5 recordings
  to LeRobot dataset format
- Add unit tests covering state concatenation, image format conversion
  (float32 CHW -> uint8 HWC), image masks, and action slicing
- Rewrite examples/ur5/README.md with step-by-step usage instructions

Also fixes two issues in the original README code outline:
- create_base_config() was missing the required model_config argument
- UR5Inputs constructor referenced a non-existent action_dim field
@jimmyt857 jimmyt857 removed their request for review April 30, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant