Closed ekerazha closed 8 years ago
Were you able to train the Stateful GRU on your data?
If so try making the batch size fixed:
predicted = model.predict(X_test, batch_size=batch_size)
Statefulness forces a cap on the batch size.
Also, note that statefulness is handled with callbacks during training. If you want to use states passed from one batch to another, I think you won't be able to use predict
. You will have to write you own function for testing. That function should get the final state of the model after each batch and pass it as initial state for the next batch. But maybe you don't have to do that if results are good enough.
Thank you for your answer.
I'm able to train the Stateful GRU, but it gives that error when I call model.predict()
I changed
predicted = model.predict(X_test)
to
predicted = model.predict(X_test, batch_size=batch_size)
but it still gives the same identical error.
What is the size of your test set and batch size?
X_test shape is (120L, 5L, 1L). Batch size is 10 (it's 10 for training too).
Stateful RNNs are now part of keras.
I have this code:
Training seems to be ok, but it gives
on model.predict().
Standard "GRU" from Keras does work fine. Theano is up-to-date (GIT version).
Am I missing something?