It’s a bit weird, that the losses are different while you get the same accuracy.
Based on this it seems that the state_dict is properly loaded, but somehow the loss calculation might be different.
Could you run a test and store the losses (unreduced) for all batches in separate lists, and compare them for the two scripts?
I cannot see any obvious issue in the code at the moment.