Skip to content

how to load pi0? #2186

@Addog666

Description

@Addog666

i use this code to load pi0:

from lerobot.policies.pi0.modeling_pi0 import PI0Policy
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

pretrained_policy_path = "lerobot/pi0_libero_base"

policy = PI0Policy.from_pretrained(pretrained_policy_path).to(device)

but throws an error:

Traceback (most recent call last):
  File "/home/wjg/pi0.py", line 16, in <module>
    policy = PI0Policy.from_pretrained(pretrained_policy_path).to(device)
  File "/data/wjg_files/lerobot/src/lerobot/policies/pi0/modeling_pi0.py", line 923, in from_pretrained
    model = cls(config, **kwargs)
  File "/data/wjg_files/lerobot/src/lerobot/policies/pi0/modeling_pi0.py", line 872, in __init__
    self.model = PI0Pytorch(config)
  File "/data/wjg_files/lerobot/src/lerobot/policies/pi0/modeling_pi0.py", line 513, in __init__
    self.paligemma_with_expert = PaliGemmaWithExpertModel(
  File "/data/wjg_files/lerobot/src/lerobot/policies/pi0/modeling_pi0.py", line 337, in __init__
    vlm_config_hf = CONFIG_MAPPING["paligemma"]()
TypeError: 'NoneType' object is not subscriptable

how can i load pi0?

Metadata

Metadata

Assignees

No one assigned

    Labels

    policiesItems related to robot policiespythonPull requests that update python codequestionRequests for clarification or additional information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions