fix(factory): ensure output and input features are set only if not already defined (#1771)
Co-authored-by: Steven Palma <imstevenpmwork@ieee.org>
This commit is contained in:
@@ -360,8 +360,10 @@ def make_policy(
|
|||||||
raise ValueError("env_cfg cannot be None when ds_meta is not provided")
|
raise ValueError("env_cfg cannot be None when ds_meta is not provided")
|
||||||
features = env_to_policy_features(env_cfg)
|
features = env_to_policy_features(env_cfg)
|
||||||
|
|
||||||
cfg.output_features = {key: ft for key, ft in features.items() if ft.type is FeatureType.ACTION}
|
if not cfg.output_features:
|
||||||
cfg.input_features = {key: ft for key, ft in features.items() if key not in 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
|
kwargs["config"] = cfg
|
||||||
|
|
||||||
if cfg.pretrained_path:
|
if cfg.pretrained_path:
|
||||||
|
|||||||
Reference in New Issue
Block a user