How are you comparing the models after storing them?
Based on your code snippet it seems you are filtering out some keys from the state_dict in load_model? If so, did you checked that this doesn’t create any mismatch in the comparison?