I implemented my seq-Keras model and it was successfully trained.
... model.fit(...) ... >>Result: Successfully completed: TrainAcc=99%, ValAcc=88%
NOW I run this code:
model.save('Model88.h5') model.evaluate(X_test, y_test) Result >> accuracy: 0.8216
but when I load the saved model(Model88) and evaluate that:
model = keras.models.load_model('Model88.h5') model.evaluate(X_test, y_test) Result >> accuracy: 0.0214 !!!
The test data is the same, the saved model and the loaded model are the same!
Why does this happen? accuracy: 82% -> 5% !!!!
I had same problem before and i found out that test accuracy was calculated wrongly during training. I had changed test batch size to 1 to fix it.
Answered By – Uur Kn
Answer Checked By – David Goodson (AngularFixing Volunteer)