Skip to content

Check for "/" in feature names #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

tlpss
Copy link
Contributor

@tlpss tlpss commented Jan 29, 2025

What this does

If you create a dataset with feature keys that contain a '/', this will work fine and you can store the dataset. However, the serialized dataset stats will be corrupt because they are flattened using a '/' as separator. Upon training, you will get 'keyErrors' as the original feature names are now no longer available in the dataset stats file.

This is rather annoying to debug when you start training, and at that point you have to recreate your datasets.

This PR adds a simple check to guard against creating a dataset with features that contain a '/' in their key, to make sure this issues is caught upon creation of the dataset.

How it was tested

Explain/show how you tested your changes.

added a test in tests/test_dataset to ensure that dataset creation fails when the feature keys contain '/'

tagging @aliberts and @Cadene since their names are linked to a related #TODO in the codebase.

Copy link
Collaborator

@aliberts aliberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you!

@aliberts aliberts merged commit c4d912a into huggingface:main Jan 29, 2025
5 checks passed
menhguin pushed a commit to menhguin/lerobot that referenced this pull request Feb 9, 2025
JIy3AHKO pushed a commit to vertix/lerobot that referenced this pull request Feb 27, 2025
Ke-Wang1017 pushed a commit to Ke-Wang1017/lerobot that referenced this pull request Mar 26, 2025
Kalcy-U referenced this pull request in Kalcy-U/lerobot May 13, 2025
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.

2 participants