title: Value error while fitting model with keras fit()
body: <h1>make a bigger datased</h1>
  <p>X = tf.range(-100,100,4)
  X</p>
  <h1>Make labes for the dataset</h1>
  <p>y = X+10
  y</p>
  <p>#1. Create the model
  model = tf.keras.Sequential([tf.keras.layers.Dense(1)])</p>
  <h1>2. compile the model</h1>
  <p>model.compile(loss = tf.keras.losses.mae, optimizer= tf.keras.optimizers.SGD(), metrics=[&quot;mae&quot;])</p>
  <h1>3. Fit the model</h1>
  <p>model.fit(X,y)</p>
  <h1>This is the error I am getting:</h1>
  <p>**ValueError                                Traceback (most recent call last)</p>
  <p> in ()
  8
  9 # 3. Fit the model (this time we'll train for longer)
  ---&gt; 10 model.fit(X,y)</p>
  <p>1 frames</p>
  <p>/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in autograph_handler(*args, **kwargs)
  1145           except Exception as e:  # pylint:disable=broad-except
  1146             if hasattr(e, &quot;ag_error_metadata&quot;):
  -&gt; 1147               raise e.ag_error_metadata.to_exception(e)
  1148             else:
  1149               raise</p>
  <p>ValueError: in user code:</p>
  <pre><code>File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/training.py&quot;, line 1021, in train_function  *
      return step_function(self, iterator)
  File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/training.py&quot;, line 1010, in step_function  **
      outputs = model.distribute_strategy.run(run_step, args=(data,))
  File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/training.py&quot;, line 1000, in run_step  **
      outputs = model.train_step(data)
  File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/training.py&quot;, line 859, in train_step
      y_pred = self(x, training=True)
  File &quot;/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py&quot;, line 67, in error_handler
      raise e.with_traceback(filtered_tb) from None
  File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/input_spec.py&quot;, line 228, in assert_input_compatibility
      raise ValueError(f'Input {input_index} of layer &quot;{layer_name}&quot; '
  
  ValueError: Exception encountered when calling layer &quot;sequential_23&quot; (type Sequential).
  
  Input 0 of layer &quot;dense_33&quot; is incompatible with the layer: expected min_ndim=2, found ndim=1. Full shape received: (None,)
  
  Call arguments received:
    • inputs=tf.Tensor(shape=(None,), dtype=int32)
    • training=True
    • mask=None
  </code></pre>
  <p>**</p>