Your approach could work, if you want to change the parameter of the model instead of the state_dict.



 asoin29:

Modifying the state_dict and reloading it essentially gives the same torch size mismatch error.


That should not be the case, if you make sure the parameter in the state_dict has the same shape as the parameter in the model.