title: TensorFlow ValueError: logits and labels must have the same shape ((25, 1) vs (1, 1))
body: <p>I have been building a classification model with 25 features and I keep getting this error code below, not sure if the error is coming from the construction of the data or the model? Could also be a problem with how I constructed the dataset tensors</p>
  <p>ps super new to tensorflow plus stack overflow</p>
  <pre><code>data = np.array(pd.read_csv('DATASET_2018.csv'))
  
  
  
  
  #creating labels 
  labels = np.array([]) 
  
  for i in range(len(data)):
      labels = np.append(labels, float(data[i][0]))
      
  labels = labels.reshape(623)
  
  
  
  
  #seperating data 
  data_set = np.array([])
  
  for i in range(len(data)):
      broken_features =  data[i][1][1:-1].split(',')
      dummy_data = [] 
      for x in broken_features:
          dummy_data.append(float(x))
      data_set = np.append(data_set, dummy_data)
      
  data_set = data_set.reshape(623, 25)
  
  
  
  #splitting data into testing and training data 
  
  test_data = data_set[int(-len(data_set)*0.20):]
  test_labels = labels[int(-len(data_set)*0.20):]
  
  train_data = data_set[:int(-len(data_set)*0.20)]
  train_labels = labels[:int(-len(data_set)*0.20)]
  
  train_labels = np.asarray(train_labels).astype('float32').reshape((-1,1))
  test_labels = np.asarray(test_labels).astype('float32').reshape((-1,1))
  
  
  
  
  print(train_data.shape, train_labels.shape)
  
  
   (499, 25) (499, 1)
      
  
  
  
  train_data = tf.random.shuffle(
      train_data, seed=None, name=None
  )
  
  data = tf.linalg.normalize(
      train_data, ord='euclidean', axis=None, name=None
  )
  
  train_dataset = tf.data.Dataset.from_tensor_slices((data[0], train_labels))
  
  test_data = tf.linalg.normalize(
      test_data, ord='euclidean', axis=None, name=None
  )
  
  test_dataset = tf.data.Dataset.from_tensor_slices((test_data[0], test_labels))
  
  
  
  
  def get_compiled_model():
      model = tf.keras.Sequential([
          tf.keras.layers.Dense(25, activation='relu'),
          tf.keras.layers.Dense(10, activation='relu'),
          tf.keras.layers.Dense(1)
      ])
      
      model.compile(optimizer='adam',
                   loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
                   metrics=['accuracy'])
      return model 
  
  
  
  
  model.summary()
  
  </code></pre>
  <pre><code>Model: &quot;sequential_11&quot;
  _________________________________________________________________
  Layer (type)                 Output Shape              Param #   
  =================================================================
  dense_35 (Dense)             (25, 25)                  50        
  _________________________________________________________________
  dense_36 (Dense)             (25, 10)                  260       
  _________________________________________________________________
  dense_37 (Dense)             (25, 1)                   11        
  =================================================================
  Total params: 321
  Trainable params: 321
  Non-trainable params: 0
  _________________________________________________________________
  </code></pre>
  <pre><code>
  
  model = get_compiled_model()
  model.fit(train_dataset, epochs=15)
  
  
   ValueError: logits and labels must have the same shape ((25, 1) vs (1, 1))
  
  </code></pre>
  <p>Thanks for any help</p>