Views
No views yet
| Metric | Value |
|---|---|
| Mean MAE | 0.079 |
| Relative Error | ~2.6% of action range |
| Best MAE | 0.0085 |
1from lerobot.policies.pi0_fast.modeling_pi0_fast import PI0FastPolicy
2from lerobot.processor.pipeline import PolicyProcessorPipeline
3
4# Load model
5policy = PI0FastPolicy.from_pretrained("gpudad/pi0fast-so101-pick-cube")
6policy.to("cuda")
7policy.eval()
8
9# Load processors
10preprocessor = PolicyProcessorPipeline.from_pretrained(
11 "gpudad/pi0fast-so101-pick-cube",
12 "policy_preprocessor.json"
13)
14postprocessor = PolicyProcessorPipeline.from_pretrained(
15 "gpudad/pi0fast-so101-pick-cube",
16 "policy_postprocessor.json"
17)
18
19# Run inference
20observation = {
21 "observation.state": state_tensor,
22 "observation.images.front": front_image,
23 "observation.images.wrist": wrist_image,
24 "observation.images.overhead": overhead_image,
25 "task": "pick up the object and place it in the target location",
26}
27
28batch = preprocessor(observation)
29batch['observation.language.attention_mask'] = batch['observation.language.attention_mask'].bool()
30
31policy.reset()
32with torch.no_grad():
33 action = policy.select_action(batch)
34
35result = postprocessor({"action": action})
36final_action = result["action"]1policy.type: pi0_fast
2policy.dtype: bfloat16
3policy.gradient_checkpointing: true
4policy.chunk_size: 10
5policy.n_action_steps: 10
6batch_size: 4
7optimizer_lr: 2.5e-5
8scheduler_warmup_steps: 4001@article{black2024pi0,
2 title={$\pi_0$: A Vision-Language-Action Flow Model for General Robot Control},
3 author={Black, Kevin and Brown, Noah and Driess, Danny and others},
4 journal={arXiv preprint arXiv:2410.24164},
5 year={2024}
6}