Skip to content

Conversation

@anredlich
Copy link

Fix: improve version compatibility for older datasets

Changes in lerobot/common/datasets/lerobot_dataset.py:

  • Add TROSSEN_V1_MESSAGE import from backward_compatibility module (line 34)
  • Add enforce_breaking_major=False to bypass strict version checking (line 113)
  • Replace SubVersionBackwardCompatibilityError with warning message using logging.warning() (lines 147+)
  • Return default version v0.0 instead of raising error when subversion metadata is missing
  • Allows working with older sample datasets so examples continue to function

What this does

Fixes crashes when using older datasets that lack trossen_subversion metadata. Previously, visualize_dataset.py and train.py would error and exit when encountering version mismatches. Now they display a warning and continue working, making it possible to try out the examples and build on them for further testing and development.

This enables backward compatibility with existing datasets while maintaining version awareness through warning messages.

Label: (🐛 Bug)

How it was tested

Before fix: Both commands crashed with SubVersionBackwardCompatibilityError
After fix: Both commands show warning and continue successfully

Tested scenarios:

  • Datasets with missing trossen_subversion metadata
  • Cross-version dataset compatibility
  • Verified existing functionality remains unchanged

How to checkout & try? (for the reviewer)

Test with older datasets that previously caused crashes:

# Visualize older dataset (should show warning, not crash)
python lerobot/scripts/visualize_dataset.py \
    --repo-id lerobot/pusht \
    --episode-index 0
python lerobot/scripts/visualize_dataset.py \
    --repo-id lerobot/aloha_sim_transfer_cube_human \
    --episode-index 0

Train with older dataset (should show warning, not crash)  
python lerobot/scripts/train.py \
    --dataset.repo_id=lerobot/aloha_sim_transfer_cube_human \
    --policy.type=act \
    --output_dir=outputs/train/act_aloha_transfer_test8 \
    --env.type=aloha \
    --env.task=AlohaTransferCube-v0 \
    --policy.device=cuda

- Add enforce_breaking_major=False to bypass strict version checking
- Convert SubVersionBackwardCompatibilityError to warning message
- Return default version v0.0 instead of raising error
- Allows working with datasets across different LeRobot versions
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.

1 participant