hub icon indicating copy to clipboard operation
hub copied to clipboard

Inception retraining gets 99% train/val accuracy, but always predicts the same class.

Open wrkgm opened this issue 7 years ago • 4 comments

Hi, I'm having an issue where the model trains without issue, reporting 100% train accuracy and 95-100% val accuracy. When I load the graph from saved at --output_graph, it predicts the first class 95% of the time. Even when I run it on the training set it does this. This equates to ~25% train accuracy, since there are 4 classes, but during training it reported 100% accuracy on training set.

Does the output graph actually go elsewhere? Am I accidentally using a graph with random weights?

Thanks!

wrkgm avatar Sep 05 '19 00:09 wrkgm

@wrkgm 100 percent Training accuracy is very uncommon and seldom occurs in standard classifcation tasks. Either your recognition problem is rather easy, your test and validation data are too much alike compared to practical scenarios, or you are actually re-classifying your training data in the test step. This is also a sign of overfitting.

Did you shuffle your data (or) is your data balanced or imbalanced? (or) might be an issue when you have sampled the data.

You can also take a look at this question to get more insight on your issue.

gowthamkpr avatar Sep 05 '19 17:09 gowthamkpr

@gowthamkpr Thanks for your response! The issue is actually not on the test set (thought maybe that will be an issue right now). I haven't even looked at the test set yet, During training, it reports 100% accuracy (yes I may have a bad dataset :) ) The problem is, if I then evaluate the model on the training set, it gets 25% accuracy. There are four classes A, B, C, and D, with roughly equal amounts. When I evaluate it afterwards, every prediction is class A. I think I am using the frozen graph wrong, saving the frozen graph wrong, or getting it from the wrong location, because this does not match the training accuracy reflected during training. It seems like I'm evaluating it on a different model

wrkgm avatar Sep 05 '19 17:09 wrkgm

There are many reasons for why your model might not be performing well @wrkgm I am doubtful whether you have shuffled your data set or no.

gowthamkpr avatar Sep 09 '19 23:09 gowthamkpr

Closing this issue as it is not related to this repo. Please post this question on stackoverflow. Thanks!

gowthamkpr avatar Sep 13 '19 17:09 gowthamkpr