getting wrong prediction with custom model after loading save model in tensorflow.js

北城余情 提交于 2019-11-28 02:21:57

The model is giving wrong prediction. What to do ?

  • check the accuracy of the model. A very low accuracy of the model will indicate that the model is either not the right one for the problem solved or that some parameters needs to be changed.

  • even if the accuracy is good the model can be wrong in predicting a particular class. In that case, the confusion matrix will be of a great help identify the classes incorrectly predicted. When those classes are identified, one can use more training data for those classes to improve their accuracy after the training


Looking at the model of the question it is clearly obvious that it is a classification model ie given an image, the model will predict the class the image belongs to.

'meanSquaredError' loss is not the best loss function for classification problem. categoricalCrossEntropy will achieve best accuracy. Even after changing the loss function, the accuracy might still not be what is expected. Then one needs to add more layers, change other parameters of the model. Then one will train and compare the accuracy, and the cycle goes on...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!