Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overfitting on ResNet18 #161

Open
MichaelLee-ceo opened this issue Mar 24, 2023 · 2 comments
Open

Overfitting on ResNet18 #161

MichaelLee-ceo opened this issue Mar 24, 2023 · 2 comments

Comments

@MichaelLee-ceo
Copy link

I copied the resnet.py for constructing ResNet18 and start training.
The hyperparameters I used to train the network are the same as defined in the main.py, but I eventually end up with overfitting on the testing set.
I got almost 98% accuracy on training set while only 89% on testing set.
Did I mis-configured something or how can I handle it to avoid overfitting? Thanks

@KWang1998
Copy link

Same here. I also got about 85% on the test set with ResNet 18. I haven't figured out the reason yet.
Have you addressed this issue? Thanks

@MichaelLee-ceo
Copy link
Author

Hi, I have figured out that the learning rate scheduler "CosineAnnealingLR" has an impact on both training and testing accuracy, which can make the model more converged at the end of the training.
After I added it back to my code, I can achieve about 93% on ResNet18, so maybe you try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants