That’s a weird issue, as both approaches should be equal, if you are loading the state_dict from a file.
Just to make sure there is no error in the first approach, since you mentioned “similar to”:
you should either load the state_dict from a file or create a copy.deepcopy of the state_dict.
Otherwise the state_dict will hold the references to the parameters and you will just load the same parameters.