I am getting the error:
Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=2
Using the model:
X = np.reshape(x_train_tfidf.shape[0], 1, x_train_tfidf.shape[1])
print(X.shape)
model.add(LSTM(30, return_sequences=True,
input_shape=X))
model.add(Flatten())
model.add(Dropout(0.25))
model.add(Dense(100,activation = 'relu'))
model.add(Dropout(0.25))
model.add(Dense(1,activation='sigmoid'))
X = np.reshape(x_train_tfidf.shape[0], 1, x_train_tfidf.shape[1])
andinput_shape=X
, it looks like you are telling the LSTM layer that the input size is the input tensor itself, not its shape. docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html $\endgroup$