Skip to content

lerobot-eval run with exception: #2246

Description

@talregev

System Info

- lerobot version: 0.3.4
- libero  version: 0.1.1
- Mujoco  version: 3.3.7
- Platform: ubuntu 24.04
- Python version: 3.12
- Huggingface Hub version: 0.35.3
- Datasets version: 4.1.1
- Numpy version: 2.2.6
- PyTorch version: 2.7.1+cpu
- Using GPU in script: No

Information

  • One of the scripts in the examples/ folder of LeRobot
  • My own task or dataset (give details below)

Reproduction

pip install git+https://github.com/huggingface/lerobot.git#egg=lerobot[libero] accelerate num2words --extra-index-url https://download.pytorch.org/whl/cpu
    lerobot-eval \
        --policy.path=lerobot/smolvla_base \
        --policy.device=cpu \
        --env.type=libero \
        --env.task=libero_object \
        --eval.n_episodes=1 \
        --eval.batch_size=1 \
        --output vla-results/smolvla_libero_cpu.json

Error

Traceback (most recent call last): File "/home/runner/.local/bin/lerobot-eval", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 756, in main eval_main() File "/home/runner/.local/lib/python3.12/site-packages/lerobot/configs/parser.py", line 225, in wrapper_inner response = fn(cfg, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 514, in eval_main info = eval_policy_all( ^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 703, in eval_policy_all tg, tid, metrics = task_runner(task_group, task_id, env) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 615, in run_one metrics = eval_one( ^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 569, in eval_one task_result = eval_policy( ^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 319, in eval_policy rollout_data = rollout( ^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/scripts/lerobot_eval.py", line 170, in rollout action = policy.select_action(observation) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/policies/smolvla/modeling_smolvla.py", line 305, in select_action actions = self._get_action_chunk(batch, noise) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/policies/smolvla/modeling_smolvla.py", line 258, in _get_action_chunk images, img_masks = self.prepare_images(batch) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.local/lib/python3.12/site-packages/lerobot/policies/smolvla/modeling_smolvla.py", line 354, in prepare_images raise ValueError( ValueError: All image features are missing from the batch. At least one expected. (batch: dict_keys(['action', 'next.reward', 'next.done', 'next.truncated', 'info', 'task', 'observation.images.image', 'observation.images.image2', 'observation.state', 'observation.language.tokens', 'observation.language.attention_mask'])) (image_features:{'observation.images.camera1': PolicyFeature(type=<FeatureType.VISUAL: 'VISUAL'>, shape=(3, 256, 256)), 'observation.images.camera2': PolicyFeature(type=<FeatureType.VISUAL: 'VISUAL'>, shape=(3, 256, 256)), 'observation.images.camera3': PolicyFeature(type=<FeatureType.VISUAL: 'VISUAL'>, shape=(3, 256, 256))})

Workaround

I solve this issue with this workaround, but I still think it should be fixed.
Not sure if it correct. I added these lines to the original command:

            --policy.input_features='{"observation.images.image":  {"type":"VISUAL","shape":[3,256,256]}, "observation.images.image2": {"type":"VISUAL","shape":[3,256,256]}}' \
            --policy.output_features='{"action":{"type":"ACTION","shape":[7]}}' \

Expected behavior

The script should run without exceptions

I verify that this PR causing this regression
#1771

Can you create tags on the lerobot-libero repo?
https://github.com/huggingface/lerobot-libero/tags

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working correctlysimulationMatters involving system simulation or modeling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions