2

Most probably the problem is related to running environment. 

There are some variables which are being computed in training phase for future use. 

If you don't change to test phase, it will use current values. 
For example dropout and batch normalization
If you use it in training mode, then for mean and variance it will use current values, 
but in test time it will use moving_mean and moving_variance

That's why you should call 

import keras.backend as K
k.set_learning_phase(0) # 0 testing, 1 training mode

Try this one. It can help to understand the difference.


+ Recent posts