Week1_lab1_Value error

these are my two arrays that I have defined:

xs = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], dtype= float)
ys = np.array([100.0, 150.0, 200.0, 250.0, 300.0, 350.0], dtype=float)

model.fit method is giving me a value error this is how i fit:

model.fit(xs, ys, epochs = 1000)
the error says

anyone else has come across this error:

ValueError: in user code:

File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 878, in train_function  *
    return step_function(self, iterator)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 867, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 860, in run_step  **
    outputs = model.train_step(data)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 808, in train_step
    y_pred = self(x, training=True)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
File "/opt/conda/lib/python3.8/site-packages/keras/engine/input_spec.py", line 227, in assert_input_compatibility
    raise ValueError(f'Input {input_index} of layer "{layer_name}" '

ValueError: Exception encountered when calling layer "sequential_16" (type Sequential).

Input 0 of layer "dense_16" 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=float32)
  • training=True
  • mask=None

Make sure your model has one input layer the definition can be similar to

model = tf.keras.Sequential([tf.keras.layers.Dense(units=1, input_shape=[1])])