File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lerobot/common/policies/smolvla Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,13 @@ def load_smolvla(
157
157
158
158
state_dict , _ = standardise_state_dict (state_dict , set (model .state_dict ().keys ()))
159
159
160
- missing , unexpected = model .load_state_dict (state_dict )
160
+ # HACK(aliberts): to not overwrite normalization parameters as they should come from the dataset
161
+ norm_keys = ("normalize_inputs" , "normalize_targets" , "unnormalize_outputs" )
162
+ state_dict = {k : v for k , v in state_dict .items () if not k .startswith (norm_keys )}
161
163
162
- if missing or unexpected :
164
+ missing , unexpected = model .load_state_dict (state_dict , strict = False )
165
+
166
+ if not all (key .startswith (norm_keys ) for key in missing ) or unexpected :
163
167
raise RuntimeError (
164
168
"SmolVLA %d missing / %d unexpected keys" ,
165
169
len (missing ),
You can’t perform that action at this time.
0 commit comments