Questions about model saving and loading and resuming training

I first run 10 epochs for training. I save model/optimizer/scheduler state_dict() in epoch 2. And I run program again to load these states and resume training. But I found that the results are not the same as before.
I think it is because the random seed. I manually set the random seed at the beginning of the program. When the program runs 2 epochs, the current random state is changed. So when I run program again, resuming the training at 2 epoch. The random seed I need to set is not the one before. How can I solve this?