Thanks a lot! I know what happend……
Model A is actually loaded from state_dict_A. Then I train model B. Finally I save model B as new_B.
After that, I load state_dict_A, and new_B. As a result, the prediction changes because I haven’t completely fixed model A.
I will never forget to use model.eval() when I have to freeze it.