-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Validation accuracy stays 0.5 when Retraining ResNet50, others are fine #96
Comments
This is related to the issue of Many workarounds are suggested in that post. |
I also had this problem. It's not only related to the batch normalization. Don't rescale your data 1/255. But rather use the preprocess_input function in your generator. |
@RunshengSong I also had this problem. My validation accuracy stuck at 51% while other network is working fine. I found the link you attached is not valid anymore. Could you describe this more detail? |
@phylliskaka Use |
instead of:
I haven't seen any more posts about this issue on google or github.... |
Thanks to this, i resolved my issue. my model got 90% val_acc under 10 epochs. Really appreciate the help. |
You are a true hero! |
@chrike-platinum |
add the preprocessing_function=preprocess_input to your imageDataGenerator like the example below from keras.applications.resnet50 import preprocess_input |
My model's accuracy stuck around 0.5 even after doing this correction: |
Thanks man |
I am comparing several architectures for retraining.
Using the Kaggle 'dogs vs cats' dataset, I set up the following:
Data generator:
Model:
Training:
I am using default sizes of each model with batch sizes of 32.
I ran this setup on my local machine: (Windows10/GTX970) and on Googles Colab (Tesla K80)
Using InceptionV3 and VGG19, the training and validation run as expected.
When I use Resnet50, the training looks fine, but validation returns 0.5 accuracy
A sample of some predictions after training:
It looks very suspicious. Also, it does not matter if I predict samples from my validation or training set, the results are similar.
The text was updated successfully, but these errors were encountered: