Keras input dimension bug?
When you do model.predict(X) the first axis in X is always an index in a batch. So if you want to predict on one sample, do something like X = np.expand_dims(X, axis=0)

In your case, this should work:

old_qval = model.predict( np.expand_dims(old_state_m, axis=0) )