Error: Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=2 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'))
It's probably this way..(not sure , give it a try)

Iputs needs to be reshaped to be [samples, time steps, features]

so 

TrainX= np.reshape(TrainX,(TrainX.shape[0], 1, TrainX.shape[1]))


You need to passin the actual vector also?