Let us consider about training and evaluation.

Training is to update parameters by back propagation.
Evaluation is to verify the result of training.

So these two modes should not been in same for-loop.
The sequence of your code means;

train the model, generates result, and update parameters.
eval the model using updated parameters, and generates result.
repeat this sequence by for-loop (going back to 1)

So, different number is alway there, I think.
NOTE : training and validation have not use same data set, in order to check overfitting on your model.