Train and test with the same data

I trained Resnet18 pre-trained with a 2-class data.
And I got a good accuracy , but to evaluate my model, I also used the data I used for training to test., but unfortunately the accuracy went down. I do not know where the problem comes from. While the data are the same for testing and training.
please guide me.

You may need to provide more information with the post such as what’s the training accuracy, test accuracy, the method used to test, etc.
An obvious answer would be, that the model did not learn anything over the training.
However, if you are sure that the model learns during training, it might be an issue with the testing code?

1 Like

Just to add one point, make sure you’re putting your module in .eval() mode before testing. Otherwise, you could see weird results.

1 Like