From 235bc3a78a16ab057ca54c9e87d527497cbb05ab Mon Sep 17 00:00:00 2001 From: Khalil Meftah Date: Fri, 10 Jul 2026 14:05:29 +0200 Subject: [PATCH] fix(processor): add lazy import fallback for unregistered processor steps --- src/lerobot/processor/pipeline.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lerobot/processor/pipeline.py b/src/lerobot/processor/pipeline.py index b9b9c6c43..8e0aedba9 100644 --- a/src/lerobot/processor/pipeline.py +++ b/src/lerobot/processor/pipeline.py @@ -1054,8 +1054,20 @@ class DataProcessorPipeline[TInput, TOutput](HubMixin): try: step_class = ProcessorStepRegistry.get(step_entry["registry_name"]) return step_class, step_entry["registry_name"] - except KeyError as e: - raise ImportError(f"Failed to load processor step from registry. {str(e)}") from e + except KeyError: + registry_name = step_entry["registry_name"] + module_path = f"lerobot.processor.{registry_name}" + try: + importlib.import_module(module_path) + step_class = ProcessorStepRegistry.get(registry_name) + return step_class, registry_name + except (ImportError, ModuleNotFoundError, KeyError): + raise ImportError( + f"Failed to load processor step from registry. " + f"Processor step '{registry_name}' not found in registry. " + f"Available steps: {list(ProcessorStepRegistry._registry.keys())}. " + f"Make sure the step is registered using @ProcessorStepRegistry.register()" + ) from None else: # Fallback to dynamic import using the full class path full_class_path = step_entry["class"]