fix(record): pass rename_map to make_policy in lerobot-record#3183
fix(record): pass rename_map to make_policy in lerobot-record#3183changer-changer wants to merge 1 commit intohuggingface:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes lerobot-record policy instantiation when datasets use renamed observation keys by forwarding cfg.dataset.rename_map into make_policy(), aligning lerobot-record with other entrypoints (e.g., lerobot-eval) and preventing visual feature mismatch errors.
Changes:
- Pass
rename_map=cfg.dataset.rename_maptomake_policy()during recording policy load. - Reformat the
policy = ...assignment into a multiline conditional expression (no behavior change beyond the new argument).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Follow-up update: I added a regression test (tests/test_control_robot.py::test_record_passes_rename_map_to_make_policy) to explicitly validate that cfg.dataset.rename_map is forwarded to make_policy() in lerobot-record. This makes the fix behavior explicit and protects against regressions in future refactors. |
|
Gentle follow-up: this branch now includes a regression test that asserts Since checks are green, I’d appreciate a quick review when you have a moment. |
f04803c to
32ea203
Compare
|
Hi @maintainers, gentle ping on this PR. It's been a few days since the last update. The branch has been rebased to the latest main and all feedback has been addressed. Would appreciate a review when you have a moment. Thanks! |
|
Hi @maintainers, gentle follow-up on this PR. It's been a few days since the last update. All feedback has been addressed and the branch is ready for review. Would appreciate a look when you have a moment. Thanks! |
Summary
Fixes a bug where
cfg.dataset.rename_mapwas not forwarded tomake_policy()inlerobot-record, causing feature mismatch errors when recording with renamed camera keys.Motivation
When using
lerobot-recordwith--dataset.rename_mapto remap camera key names (e.g., mappingobservation.images.fronttoobservation.images.camera1), the rename mapping was not applied during policy instantiation. This caused afeature mismatcherror because the policy expected keys with the original names but received renamed keys.The
make_policy()function already supports arename_mapparameter — it just was not being passed.Fix
1-line change in
src/lerobot/scripts/lerobot_record.py:507:Related
Checklist
ruff checkpassesruff formatapplied