title: ValueError: Input 0 of layer dense_1 is incompatible with the layer
body: <p>I'm using tensorflow for the first time and amusing it to classify data with 18 features into 4 classes.</p>
  <p>The dimensions of X_train are: (14125,18).</p>
  <p>This is my code:</p>
  <pre><code>dataset = tf.data.Dataset.from_tensor_slices((np.array(X_train.values, dtype=float),
                                 np.array(y_train.pet_category.values, dtype=float)))
  train_data = dataset.shuffle(len(X_train)).batch(32)
  
  vdataset = tf.data.Dataset.from_tensor_slices((np.array(X_val.values, dtype=float)))
  val_data = vdataset.batch(32)
  
  tfmodel = tf.keras.Sequential([
                    tf.keras.layers.Dense(15, activation=tf.nn.relu, input_shape=(18,1)),
                    tf.keras.layers.Flatten(),
                    tf.keras.layers.Dense(10, activation=tf.nn.relu),
                    tf.keras.layers.Dense(4, activation=tf.nn.softmax)
  ])
  
  tfmodel.compile(optimizer='adam',
                  loss=tf.keras.losses.CategoricalCrossentropy(),
                  metrics=['accuracy'])
  </code></pre>
  <p>On calling <code>tfmodel.fit(dataset, epochs=15, validation_data=val_data)</code>, I'm getting the following error:</p>
  <pre><code>ValueError: Input 0 of layer dense_1 is incompatible with the layer: expected axis -1 of input shape to have value 270 but received input with shape [18, 15]
  </code></pre>
  <p>I tried looking for similar questions but couldn't find anything that'd help. Would be really helpful to solve this issue</p>
  <p>Edit: The issue was with the version. It went away when I used a lower version of TensorFlow (v 2.1.0).</p>