title: Tensorflow Keras ValueError on input shape
body: <p>I am doing a simple Conv1D using TensorFlow Keras to try out a time-series dataset.</p>
  <p><strong>Data:</strong></p>
  <pre><code>train_df = dff[:177] #get train data
  tdf = train_df.shape #get shape = (177,4)
  test = tf.convert_to_tensor(train_df)
  </code></pre>
  <p><strong>Model:</strong></p>
  <pre><code>model = tf.keras.models.Sequential([
      tf.keras.layers.Conv1D(filters=32,
                             kernel_size=1,
                             strides=1,
                             padding=&quot;causal&quot;,
                             activation=&quot;relu&quot;,
                             input_shape=tdf),
      tf.keras.layers.MaxPooling1D(pool_size=2, strides=1, padding=&quot;valid&quot;)
  ])
  
  lr_schedule = tf.keras.optimizers.schedules.ExponentialDecay(5e-4,
                                                               decay_steps=1000000,
                                                               decay_rate=0.98,
                                                               staircase=False)
  model.compile(loss=tf.keras.losses.MeanSquaredError(),
                optimizer=tf.keras.optimizers.SGD(learning_rate=lr_schedule, momentum=0.8),
                metrics=['mae'])
  model.summary()
  </code></pre>
  <p><strong>Summary:</strong></p>
  <pre><code>Model: &quot;sequential_13&quot;
  _________________________________________________________________
  Layer (type)                 Output Shape              Param #   
  =================================================================
  conv1d_16 (Conv1D)           (None, 177, 32)           160       
  _________________________________________________________________
  max_pooling1d_8 (MaxPooling1 (None, 176, 32)           0         
  =================================================================
  Total params: 160
  Trainable params: 160
  Non-trainable params: 0
  </code></pre>
  <p><strong>Fit:</strong></p>
  <pre><code>trainedModel = model.fit(test,
                      epochs=100,
                      steps_per_epoch=1,
                      verbose=1)
  </code></pre>
  <p>Error raised @ Fit:</p>
  <pre><code>ValueError: Input 0 of layer sequential_13 is incompatible with the layer: : expected min_ndim=3, found ndim=2. Full shape received: (2, 1)
  </code></pre>
  <p>From the various SO, it was said that this is due to the input data shape. So I tried a recommendation in a SO to reshape the my data and re-input it</p>
  <p><strong>Reshape:</strong></p>
  <pre><code>X_train=np.reshape(test,(test.shape[0], test.shape[1],1))
  </code></pre>
  <p><strong>Error raised @ Fit after reshaping:</strong></p>
  <pre><code>ValueError: Input 0 of layer sequential_14 is incompatible with the layer: expected axis -1 of input shape to have value 4 but received input with shape (177, 4, 1)
  </code></pre>
  <p>I am at a loss here. What is the way to tackle this?</p>