Yes, you are right.
I tried the two ways that you advised, the results are improved a lot.
Now I have two results:


I freeze all the earlier layers, only update the last fully connected layers(Resnet 18). No dropout.Train accuracy:0.80; Val accuracy:0.76


I freeze all the earlier layers, only update the last fully connected layers(Resnet 34). And I also add a dropout layer (p = 0.5) before the fullly connected layers. Train accuracy:0.90; Val accuracy:0.81


The two are all better than my first result. Thanks for your advice.