title: Can not squeeze dim[1], expected a dimension of 1, got 2
body: <p>I have very simple input: Points, and I am trying to classify whether they are in some region or not. So my training data is of the shape <code>(1000000, 2)</code>, which is an array of the form:<br /><code>[ [x1,y1], [x2,y2],... ]</code><br />
  My labels are of a similar form (Shaped <code>(10000, 2)</code>):<br />
  <code>[ [1,0], [0,1], [0,1],... ]</code><br />
  (<code>[0,1]</code>means the point is in the region, <code>[1,0]</code> means it isn't)</p>
  
  <p>My model is set up this way:</p>
  
  <pre><code>import tensorflow as tf
  from tensorflow import keras
  import numpy as np
  
  # Reads the points and labels from .csv format files
  train_data = np.genfromtxt('data/train_data.csv', delimiter=',')
  train_labels = np.genfromtxt('data/train_labels.csv', delimiter=',')
  
  model = keras.models.Sequential()
  model.add(keras.layers.Dense(128, activation='relu', input_shape=(2,)))
  model.add(keras.layers.Dense(128, activation='relu'))
  model.add(keras.layers.Dense(2, activation='softmax'))
  
  model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
  model.fit(train_data, train_labels, epochs=1, batch_size=100, verbose=1) # ERROR
  </code></pre>
  
  <p>Notice that the input shape is <code>(2,)</code>, meaning (according to the <a href="https://keras.io/layers/core/" rel="nofollow noreferrer">reference</a>) that the model would expect arrays of the form <code>(*, 2)</code>.</p>
  
  <p>I am getting the error:<br />
  <code>tensorflow.python.framework.errors_impl.InvalidArgumentError: Can not squeeze dim[1], expected a dimension of 1, got 2</code></p>
  
  <p>and I have no idea why. Any suggestions?</p>
  
  <p><strong>Stacktrace:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/omer/Desktop/Dots/train.py", line 25, in &lt;module&gt;
      model.fit(train_data, train_labels, epochs=1, batch_size=100, verbose=1)
    File "C:\Users\omer\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\engine\training.py", line 880, in fit
      validation_steps=validation_steps)
    File "C:\Users\omer\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\engine\training_arrays.py", line 329, in model_iteration
      batch_outs = f(ins_batch)
    File "C:\Users\omer\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\backend.py", line 3076, in __call__
      run_metadata=self.run_metadata)
    File "C:\Users\omer\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\client\session.py", line 1439, in __call__
      run_metadata_ptr)
    File "C:\Users\omer\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
      c_api.TF_GetCode(self.status.status))
  tensorflow.python.framework.errors_impl.InvalidArgumentError: Can not squeeze dim[1], expected a dimension of 1, got 2
       [[{{node metrics/acc/Squeeze}}]]
  </code></pre>