Skip to content

[Bug]: LeRobot v3 exports cannot be opened by the official lerobot loader (KeyError: 'codebase_version') #778

Open

Description

@Leo-Y-Zhang

Version or commit

Reproduced with examples/lerobot/export.py from #777 (plus the small #776 follow-up described below). main at 3a99508 writes the same meta/info.json keys (code, version, no codebase_version).

Environment

Linux (Debian 12 container), Python 3.11 for hflow (uv sync --locked), system FFmpeg 5.1. The official loader runs in a separate Python 3.12 environment with lerobot==0.4.4 (dataset format CODEBASE_VERSION = "v3.0"), torch==2.7.1 and torchvision==0.22.1 (CPU wheels), so hflow's lockfile is untouched.

Minimal reproduction

  1. Export any selection with examples/lerobot/export.py (I used the synthetic corpus from tests/test_lerobot_export.py, with two tiny real MP4 cameras so frames can decode).
  2. In the LeRobot environment, open the export locally with no Hub access:
from lerobot.datasets.lerobot_dataset import LeRobotDataset, LeRobotDatasetMetadata

meta = LeRobotDatasetMetadata("local/export", root="exported")
ds = LeRobotDataset("local/export", root="exported", video_backend="pyav")

Expected behavior

The export opens in the official loader and serves frames, as _validate_v3 describes ("which is what makes the staged directory loadable by the official lerobot package").

Actual behavior

lerobot/datasets/lerobot_dataset.py:192: KeyError: 'codebase_version'

meta/info.json carries "code": "LeRobotDataset/v3" and "version": 1, but not the codebase_version key the loader reads first. Past that key, the loader reads total_tasks, expects splits in its range form ("train": "0:N"), and looks tasks up by position in meta/tasks.parquet, taking the task string from the DataFrame index; the fix below covers those too.

Additional context

I have a fix ready that writes those fields (keeping sparse source task IDs), keeps the code marker for the existing verifier, and adds an opt-in test that exports real MP4s and reads metadata, camera tensors and a whole episode through the official loader in a separate environment (skipped in default CI). With it, the official loader opens the export; without it, the same test fails with the KeyError above. It builds on #777 and on a small follow-up for the second finding in #776, so I'll open it once #777 is merged, given the one-open-PR rule.

Activity

  1. kstonekuan commented on Nov 21, 2026

    @kstonekuan
    Contributor

    This is available to pick up again. If you still have the fix handy, I’d welcome the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions