Seems like the Keras .fit and .evaluate methods give different training accuracy (yet the same validation accuracy). Same thing on loss.?
training's loss/accuracy are not calculated for the whole dataset every time.
It is calculated for the current batch and averaged successively.
test's loss/accuracy is calculated at the end of an epoch for the whole test data.
Check these references
Keras FAQ
SO Answer
You may put the validation data same as the train data to check it.
ann=model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, validation_data=(x_train,y_train))

# Evaluate the trained model
print(&quot;\n&quot;)
score = model.evaluate(x_train, y_train, verbose=0)


Or, you may write a custom callback to print appropriate logs as suggested in the SO answer.