Reputation: 1021
I am trying to train a simple LSTM in Keras. My data have the following dimensions:
train_x.shape, train_y.shape, test_x.shape, test_y.shape
> ((534, 1, 7), (534, 1, 1), (259, 1, 7), (259, 1, 1))
The model is defined as follows:
model = Sequential()
model.add(LSTM(100, input_shape = (train_x.shape[1],train_x.shape[2]), return_sequences=True))
model.add(Dense(1))
model.compile(loss='mae', optimizer='adam')
res = model.fit(train_x, train_y, validation_data=(test_x,test_y), epochs=100, batch_size=32, verbose=2, shuffle=False)
A smaller version of the network that I was toying with previously worked, but when I increased the number of hidden nodes and epochs, I started getting the following error:
InvalidArgumentError: Node 'IsVariableInitialized_3370': Unknown input node 'lstm_17/kernel'
And I seem to be unable to compile the model by downsizing to its previous configuration. I'm not terrribly familiar with Tensorflow internals so the error and stack trace are not helpful to me. Can anyone explain what this error means and/or what I might be doing wrong?
Upvotes: 1
Views: 1630
Reputation: 31
I got a very similar error and I am also using LSTMs. I am using Spyder on Windows and I simply had to restart Spyder to avoid the problem.
Upvotes: 3