I am trying to build a neural network using Keras but am getting the error:
ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 25168 but received input with shape (None, 34783)
I defined the model to be:
model = Sequential()
model.add(Dense(1024, input_dim = len(X), activation = 'relu'))
model.add(Dense(6, activation='softmax'))
In this, X is the result of using scikit-learn it's CountVectorizer() (after it is trained) as follows:
X = count_vectorizer.transform(X).todense()
Is there any method to fix this? Looking around I found that I might need to reshape the data, however I have no idea how and where.