mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-30 18:31:25 +00:00
Do not add model prefix to normalization
This commit is contained in:
@@ -919,7 +919,10 @@ class PI05OpenPIPolicy(PreTrainedPolicy):
|
||||
remap_count = 0
|
||||
|
||||
for key, value in fixed_state_dict.items():
|
||||
if not key.startswith("model."):
|
||||
if not key.startswith("model.") and not any(
|
||||
key.startswith(prefix)
|
||||
for prefix in ["normalize_inputs.", "normalize_targets.", "unnormalize_outputs."]
|
||||
):
|
||||
new_key = f"model.{key}"
|
||||
remapped_state_dict[new_key] = value
|
||||
remap_count += 1
|
||||
|
||||
@@ -938,7 +938,10 @@ class PI0OpenPIPolicy(PreTrainedPolicy):
|
||||
remap_count = 0
|
||||
|
||||
for key, value in fixed_state_dict.items():
|
||||
if not key.startswith("model."):
|
||||
if not key.startswith("model.") and not any(
|
||||
key.startswith(prefix)
|
||||
for prefix in ["normalize_inputs.", "normalize_targets.", "unnormalize_outputs."]
|
||||
):
|
||||
new_key = f"model.{key}"
|
||||
remapped_state_dict[new_key] = value
|
||||
remap_count += 1
|
||||
|
||||
Reference in New Issue
Block a user