Constrain datasets and fail clearly on unsupported LeRobot dataset formats#972
Open
0xadvait wants to merge 1 commit into
Open
Constrain datasets and fail clearly on unsupported LeRobot dataset formats#9720xadvait wants to merge 1 commit into
0xadvait wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short-term mitigation for the failure class discussed in #706 (also #753, #948, #916), as offered there.
The two failure modes
Unbounded
datasets:datasets4.0 returns lazyColumnobjects fords["col"], which breaks the pinned lerobot'storch.stack(self.hf_dataset["timestamp"])withTypeError: 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 whyuv syncenvironments are immune.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: adddatasets>=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: checkcodebase_versionfrom the dataset metadata thatcreate_torch_datasetalready loads, and raise an actionable error for v3.0+ formats naming the supported version (v2.1) before any dataset construction. This is the singleLeRobotDatasetconstruction site, andcompute_norm_statsroutes through it, so both training and norm-stats get the clear error.ruff checkandruff format --checkpass.data_loader_test.py: 7 passed plus the pre-existingtest_with_real_datasetfailure 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