fix: auto-migrate old Hub models missing processor configs#3001
Open
sattyamjjain wants to merge 1 commit intohuggingface:mainfrom
Open
fix: auto-migrate old Hub models missing processor configs#3001sattyamjjain wants to merge 1 commit intohuggingface:mainfrom
sattyamjjain wants to merge 1 commit intohuggingface:mainfrom
Conversation
Old pre-trained models on HuggingFace Hub (e.g., lerobot/diffusion_pusht) lack the policy_preprocessor.json and policy_postprocessor.json files required by the new processor pipeline system (0.4.4+). This causes a FileNotFoundError when loading these models with `lerobot-eval`. This commit adds two layers of backward compatibility: Layer 1 - Detection (pipeline.py): - Add `_is_old_hub_model()` to detect repos with config.json but no processor configs - Raise `ProcessorMigrationError` with actionable migration command instead of a cryptic FileNotFoundError Layer 2 - Auto-migration (factory.py): - Catch `ProcessorMigrationError` in `make_pre_post_processors()` - Download model.safetensors and extract normalization stats from the old built-in normalization layers - Auto-create processor pipelines using the existing policy factory - Log a warning suggesting the permanent migration script Tested end-to-end: `lerobot-eval --policy.path=lerobot/diffusion_pusht` now works directly on main without manual migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
lerobot/diffusion_pusht) lack thepolicy_preprocessor.jsonandpolicy_postprocessor.jsonfiles required by the new processor pipeline system (0.4.4+), causingFileNotFoundErroronlerobot-eval_is_old_hub_model()toDataProcessorPipelinethat detects repos withconfig.jsonbut no processor configs, raisingProcessorMigrationErrorwith an actionable migration command instead of a cryptic errormake_pre_post_processors()infactory.pycatchesProcessorMigrationError, downloadsmodel.safetensors, extracts normalization stats from the old built-in normalization layers, and auto-creates processor pipelines — with a warning suggesting the permanent migration scriptFiles Changed
src/lerobot/processor/pipeline.py_is_old_hub_model()classmethod + migration detection in_load_config()Hub pathsrc/lerobot/policies/factory.pyProcessorMigrationErrorcatch +_auto_create_processors_from_pretrained()helpertests/processor/test_pipeline_from_pretrained_helpers.pyTest plan
lerobot-eval --policy.path=lerobot/diffusion_pushtworks end-to-end (33.3% success, avg_sum_reward 94.5)test_pipeline_from_pretrained_helpers.pyextract_normalization_statsfrom migration module)🤖 Generated with Claude Code