-
Notifications
You must be signed in to change notification settings - Fork 4.2k
save_episode fails for shape=(1,) numeric features due to scalar conversion assumptions #3343
Copy link
Copy link
Open
Labels
bugSomething isn’t working correctlySomething isn’t working correctlydatasetIssues regarding data inputs, processing, or datasetsIssues regarding data inputs, processing, or datasetsdependenciesConcerns about external packages, libraries, or versioningConcerns about external packages, libraries, or versioningdocumentationImprovements or fixes to the project’s docsImprovements or fixes to the project’s docsenhancementSuggestions for new features or improvementsSuggestions for new features or improvementsperformanceIssues aimed at improving speed or resource usageIssues aimed at improving speed or resource usagequestionRequests for clarification or additional informationRequests for clarification or additional informationtestsProblems with test coverage, failures, or improvements to testingProblems with test coverage, failures, or improvements to testing
Metadata
Metadata
Assignees
Labels
bugSomething isn’t working correctlySomething isn’t working correctlydatasetIssues regarding data inputs, processing, or datasetsIssues regarding data inputs, processing, or datasetsdependenciesConcerns about external packages, libraries, or versioningConcerns about external packages, libraries, or versioningdocumentationImprovements or fixes to the project’s docsImprovements or fixes to the project’s docsenhancementSuggestions for new features or improvementsSuggestions for new features or improvementsperformanceIssues aimed at improving speed or resource usageIssues aimed at improving speed or resource usagequestionRequests for clarification or additional informationRequests for clarification or additional informationtestsProblems with test coverage, failures, or improvements to testingProblems with test coverage, failures, or improvements to testing
Type
Fields
Give feedbackNo fields configured for issues without a type.
Ticket Type
What kind of ticket are you opening?
Environment & System Info
Description
When a numeric feature is declared as
shape=(1,),save_episode()can fail depending on dependency stack.LeRobot maps
shape=(1,)numeric features todatasets.Value(...). In the save path, values can end up in(N,1)form before passing todatasets.Dataset.from_dict. This relies on implicit scalar conversion behavior downstream.In stricter stacks this fails with:
TypeError: only 0-dimensional arrays can be converted to Python scalarsContext & Reproduction
Minimal reproduction at datasets layer (same schema assumption LeRobot uses for
shape=(1,)):Observed:
list_shape1/stacked_N1: may fail in stricter stackslist_scalar: passes consistentlyLeRobot-side impact:
add_frameacceptsnp.array([x])forshape=(1,)save_episodemay fail due to(N,1)-> scalar conversion assumptionsRelevant logs or stack trace
Representative traceback:
Checklist
mainbranch.Additional Info / Workarounds
Proposed fix:
shape=(1,)numeric columns from(N,1)to(N,)beforeDataset.from_dict.add_frameinput contract unchanged (np.array([x])still accepted).