title: Shape mismatch with Tensorflow Dataset and Network
body: <p>I am getting an error relating to shapes whilst defining a very simple network using Tensorflow 2.</p>
  
  <p>My code is:</p>
  
  <pre><code>import tensorflow as tf
  import pandas as pd
  
  data = pd.read_csv('data.csv')
  
  target = data.pop('result')
  target = tf.keras.utils.to_categorical(target.values, num_classes=3)
  data_set = tf.data.Dataset.from_tensor_slices((data.values, target))
  
  model = tf.keras.Sequential([
      tf.keras.layers.Input(shape=data.shape[1:]),
      tf.keras.layers.Dense(12, activation='relu'),
      tf.keras.layers.Dense(3, activation='softmax')
  ])
  
  model.compile(optimizer='adam', loss='categorical_crossentropy')
  model.fit(data_set, epochs=5)
  
  </code></pre>
  
  <p>The call to fit() throws the following error:</p>
  
  <pre><code>ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 12 but received input with shape [12, 1]
  </code></pre>
  
  <p>Walking through the code:</p>
  
  <ol>
  <li>The input CSV file has thirteen columns - with the last being the label</li>
  <li>This is converted to a 3 bit one-hot encoding</li>
  <li>The Dataset is constructed of two Tensors - one of shape (12,) and the other of shape (3,)</li>
  <li>The network Input layer defines it's expected shape as be the value data shape ignoring the first axis which is the batch size</li>
  </ol>
  
  <p>I am stumped about why there is mismatch between the shape of the data and the expected data shape for the network - especially as the latter is defined by reference to the former.</p>