Replace version compatibility error with a warning #51
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.
Fix: improve version compatibility for older datasets
Changes in
lerobot/common/datasets/lerobot_dataset.py:TROSSEN_V1_MESSAGEimport frombackward_compatibilitymodule (line 34)enforce_breaking_major=Falseto bypass strict version checking (line 113)SubVersionBackwardCompatibilityErrorwith warning message usinglogging.warning()(lines 147+)v0.0instead of raising error when subversion metadata is missingWhat this does
Fixes crashes when using older datasets that lack
trossen_subversionmetadata. Previously,visualize_dataset.pyandtrain.pywould 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
SubVersionBackwardCompatibilityErrorAfter fix: Both commands show warning and continue successfully
Tested scenarios:
trossen_subversionmetadataHow 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