Why does my CIFAR 100 CNN model mainly predict two classes?

前端 未结 4 1106
不思量自难忘°
不思量自难忘° 2021-01-17 00:06

I am currently trying to get a decent score (> 40% accuracy) with Keras on CIFAR 100. However, I\'m experiencing a weird behaviour of a CNN model: It tends to predict some c

4条回答
  •  情话喂你
    2021-01-17 00:49

    If you get good accuracy during training and validation, but not when testing, make sure you do exactly the same preprocessing on your dataset in both cases. Here you have when training:

    X_train /= 255
    X_val /= 255
    X_test /= 255
    

    But no such code when predicting for your confusion matrix. Adding to testing:

    X_val /=  255.
    

    Gives the following nice looking confusion matrix:

提交回复
热议问题