When Keras' model contains Dropout component in it, we must tell the model whether we are training or test mode because the network behaves differently. The solution is mentioned in github issue and Keras docs.
[code lang="python"] from keras.backend import set_learning_phase ... set_learning_phase(1) model = ... model.compile(...) model.summary() model.fit(...) set_learning_phase(0) model.predict() [/code]