Input 0 is incompatible with layer lstm: expected ndim=3, found ndim=2 in Keras
I'm using Keras 2.2 LSTM and want to build a recurrent network, but I can't find the reason of this error. Here is the code
model=Sequential()
model.add(LSTM(16, return_sequences=True, activation='relu'))
model.add(LSTM(16, activation='relu'))
model.add(Dense(32, activation='relu'))
model.add(Dropout(0.3))
model.add(Dense(10, activation='softmax'))
model.compile(optimizer='adam',
loss='mean_squared_error',
metrics=['accuracy'])
Net = model.fit(x_train, y_train, batch_size=32, epochs=40)
I'm still getting this issue
ValueError: Input 0 is incompatible with layer lstm: expected ndim=3, found ndim=2
Any ideas about this?