I am trying to replicate the code on http://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/ (first example). The code can be found in the part "LSTM Networks for Regression". However, my question mainly refers to the following line:
model.fit(trainX, trainY, epochs=100, batch_size=1, verbose=2)
When I execute this line, I get the following Exception:
model.fit(trainX, trainY, batch_size=1, verbose=2, epochs = 100) File "/usr/local/lib/python2.7/site-packages/keras/models.py", line 612, in fit str(kwargs)) Exception: Received unknown keyword arguments: {'epochs': 100}
If I leave the keyword 'epochs' away, everything works fine. But of course, this is highly unsatisfactory since I want to increase the number of epochs. Can anyone help?
The epoch flags were CHANGED in version 2+, for version 1+ use nb_epoch instead.
model.fit(trainX, trainY, nb_epoch=100, batch_size=1, verbose=2)
To check your Keras version ..
import keras
print(keras.__version__)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With