title: How do I fix this dimenion error in keras / tensorflow?
body: <p>I am trying to fit a model that predicts a 1 or a 0 for each row of the X array. X is an array of shape (1000,26) and Y is of shape (1000, 1).For whatever reason tf/keras doesn't seem to like my inputs. </p>
  
  <p>So far I have tried changing the input type. It comes in the form of a pickle and then is turned into a numpy array by using the "np.values" function. Before I was using tf.constant(training) instad of X = training.values but all changing that did was give me a slightly different error (both included below)</p>
  
  <p>This is the full code minus the imports and loading of some other data files. </p>
  
  <pre class="lang-py prettyprint-override"><code>training = pd.read_pickle("./training.pkl")
  train_labels = pd.read_pickle("./train_labels.pkl")
  
  X = training.values
  Y = train_labels.values
  model = models.Sequential()
  
  model.add(layers.Dense(46, activation='relu', input_dim=26))
  model.add(layers.Dense(46, activation='relu'))
  model.add(layers.Dense(46, activation='relu'))
  model.add(layers.Dense(2, activation='softmax'))
  
  model.summary()
  
  model.compile(optimizer='adam',
      loss='binary_crossentropy',
      metrics=['binary_accuracy'])
  
  
  model.fit(X, Y, epochs=3, steps_per_epoch=100)
  </code></pre>
  
  <p>The current error:</p>
  
  <pre class="lang-py prettyprint-override"><code>Error when checking target: expected dense_24 to have shape (2,) but got array with shape (1,)
  </code></pre>
  
  <p>Error message when using tf.constant </p>
  
  <pre class="lang-py prettyprint-override"><code>Incompatible shapes: [1000] vs. [1000,2]
  </code></pre>