Fix Multi File Aggregate Datasets #2126
Open
+12
−7
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.
There is a bug in the
src\lerobot\datasets\aggregate.py
file where the latest_duration key is being updated incorrectly which is causing training for the newly aggregated datasets to fail.This occurs when aggregating 3+ datasets but was also occuring when video data was exceeding the "DEFAULT_VIDEO_FILE_SIZE_IN_MB" size.
This PR fixes this by removing the unused episode duration and properly updating the latest_duration key data by setting it equal to the timestamps_shift_s instead of adding the ever increasing timestamps_shift_s variable.
We have also set the latest_duration to 0 when rotating to a new file / chunk as the episode metadata parquet file requires the timestamp for a new file to begin at 0.
The existing tests pass here
A robust way to confirm this fix works is to get 3 datasets and combine them and test to ensure the standard training script trains properly.
A second test would be to get datasets such that the video data pushes past the DEFAULT_VIDEO_FILE_SIZE_IN_MB variable