From f7c4f995451e36c76d51dbf2c01dd7b6b857a520 Mon Sep 17 00:00:00 2001 From: Maximilian Li Date: Sat, 18 Oct 2025 00:50:34 +0200 Subject: [PATCH] fix(factory): ensure output and input features are set only if not already defined (#1771) Co-authored-by: Steven Palma --- src/lerobot/policies/factory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lerobot/policies/factory.py b/src/lerobot/policies/factory.py index cfb550ab..9c67e317 100644 --- a/src/lerobot/policies/factory.py +++ b/src/lerobot/policies/factory.py @@ -360,8 +360,10 @@ def make_policy( raise ValueError("env_cfg cannot be None when ds_meta is not provided") features = env_to_policy_features(env_cfg) - cfg.output_features = {key: ft for key, ft in features.items() if ft.type is FeatureType.ACTION} - cfg.input_features = {key: ft for key, ft in features.items() if key not in cfg.output_features} + if not cfg.output_features: + cfg.output_features = {key: ft for key, ft in features.items() if ft.type is FeatureType.ACTION} + if not cfg.input_features: + cfg.input_features = {key: ft for key, ft in features.items() if key not in cfg.output_features} kwargs["config"] = cfg if cfg.pretrained_path: