Besides what @Keyv_Krmn mentioned, check if you are using the same PyTorch versions, since loading a state_dict should be backwards compatible but not necessarily forwards compatible.
I.e. storing a state_dict in an older PyTorch version and loading it with a newer one should work, while the opposite direction could fail.