Network always classify last class it was trained on

(Ditlev Jørgensen) #1

As the title goes.
My network classify all samples as the last class it was trained on. It doesnt matter if it trained for 12 hours, 12 minutes, using 100000 samples or 10 samples etc.

It always only classify the last class it was trained on. So if last training loop was a class 0 all classifications are vecome 0.

Is there a known fix to this issue? How to i find what causes this?


How are your training and validation accuracies during training?
Do you set your model to eval using model.eval() before testing it?

(Ditlev Jørgensen) #3

Thanks for the reply!

I set model.train() during training and model.eval() during testing. (I have dropout layer)

I dont calculate any validation accuracies during training. I’ll look into doing that. What insight will validation accuracies give me?


If your model behaves strange during training, the training accuracies should be high, since your model seems to “learn” the last classes, while the validation set should score really low.