Skip to content

Constrain datasets and fail clearly on unsupported LeRobot dataset formats#972

Open
0xadvait wants to merge 1 commit into
Physical-Intelligence:mainfrom
0xadvait:fix/lerobot-dataset-version-errors
Open

Constrain datasets and fail clearly on unsupported LeRobot dataset formats#972
0xadvait wants to merge 1 commit into
Physical-Intelligence:mainfrom
0xadvait:fix/lerobot-dataset-version-errors

Conversation

@0xadvait

Copy link
Copy Markdown

Short-term mitigation for the failure class discussed in #706 (also #753, #948, #916), as offered there.

The two failure modes

  1. Unbounded datasets: datasets 4.0 returns lazy Column objects for ds["col"], which breaks the pinned lerobot's torch.stack(self.hf_dataset["timestamp"]) with TypeError: stack(): argument 'tensors' ... not Column (lerobot dataset v2.1 compute_norm_stats error #753). Neither openpi nor the pinned lerobot (datasets>=2.19.0, no upper bound) prevents resolving 4.x, so every non-uv-locked install hits this. The uv lockfile happens to resolve 3.6.0, which is why uv sync environments are immune.

  2. LeRobot v3-format datasets: datasets produced by recent lerobot releases cannot be read by the pinned lerobot at all, and users get deep, misleading tracebacks instead of being told the format is unsupported (PI05 run compute_nome_stats #948, Lerobot code like the ones inside data_loader are deprecated. #916).

Changes

  • pyproject.toml: add datasets>=2.19.0,<4.0.0 (matches the locked 3.6.0; lockfile diff is only the new requirement entry, no churn).
  • data_loader.py: check codebase_version from the dataset metadata that create_torch_dataset already loads, and raise an actionable error for v3.0+ formats naming the supported version (v2.1) before any dataset construction. This is the single LeRobotDataset construction site, and compute_norm_stats routes through it, so both training and norm-stats get the clear error.
  • Tests for the version gate (accepts v2.1/2.1, rejects v3.0/v3.1 with the actionable message).

ruff check and ruff format --check pass. data_loader_test.py: 7 passed plus the pre-existing test_with_real_dataset failure that reproduces identically on clean main (unrelated dataset-fetch issue).

The longer-term lerobot version bump is a separate conversation in #706; this PR just stops the bleeding with clear errors.

Fixes #753

…rmats

datasets 4.0 returns lazy Column objects for column access, which breaks
the pinned lerobot with 'TypeError: stack(): ... not Column' in any
environment that does not use the uv lockfile, since neither openpi nor
the pinned lerobot bound datasets from above. Datasets stored in the
newer LeRobot v3 format fail much deeper with misleading tracebacks
because the pinned lerobot can only read format v2.1. This adds an
explicit datasets>=2.19.0,<4.0.0 dependency and an early codebase
version check that raises an actionable error before constructing the
dataset.

Fixes Physical-Intelligence#753
@jimmyt857 jimmyt857 removed their request for review June 13, 2026 02:24
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.

lerobot dataset v2.1 compute_norm_stats error

1 participant