title: Keras: Expected 3 dimensions, but got array with shape - dense model
body: <p>I want to do multi label classification (20 distinct output labels), based on vectorized words using TfidfVectorizer. I have set of 39974 rows each one containing 2739 items (zeros or ones).</p>
  
  <p>I would like to classify this data using Keras model which will contain 1 hidden layer (~20 nodes with activation='relu') and output layer equal 20 possible output values (with activation='softmax' to choose best fit).</p>
  
  <p>Here's my code so far:</p>
  
  <pre><code>model = Sequential()
  model.add(Dense(units=20, activation='relu', input_shape=tfidf_matrix.shape))
  model.add(Dense(units=20, activation='softmax'))
  model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
  model.fit(tfidf_matrix, train_data['cuisine_id'], epochs=10)
  </code></pre>
  
  <p>But got error: </p>
  
  <blockquote>
    <p>ValueError: Error when checking input: expected dense_1_input to have
    3 dimensions, but got array with shape (39774, 2739)</p>
  </blockquote>
  
  <p>How can I specify this NN to fit using this matrix? </p>