title: Running a fine-tune model for my CNN : Value Error
body: <p>So I am trying to use a pre-trained model on my data set to then compare it to my own cnn model. However, I see an error as soon as I try to do model. fit so much that ((None, 4, 4, 1) vs (None,)). Where is this error coming from? Am I supposed to edit the pre-tune cnn.</p>
  <p>The model that I am using is ResNET50 with no modification except the input layer changed to 128 and there are 2 outputs.</p>
  <p>Any help is welcome,</p>
  <p>CODE:</p>
  <pre><code>history = modelB.fit_generator(train_data,
                            validation_data = test_data, 
                            epochs=5,
                            steps_per_epoch = 1714,)
  </code></pre>
  <p>ERROR:</p>
  <pre><code>    ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-89-89a7f1c1eb60&gt; in &lt;module&gt;()
        2                               validation_data = test_data,
        3                               epochs=5,
  ----&gt; 4                               steps_per_epoch = 1714,)
  
  2 frames
  /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
  
  ValueError: in user 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 860, in train_step
          loss = self.compute_loss(x, y, y_pred, sample_weight)
      File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/training.py&quot;, line 919, in compute_loss
          y, y_pred, sample_weight, regularization_losses=self.losses)
      File &quot;/usr/local/lib/python3.7/dist-packages/keras/engine/compile_utils.py&quot;, line 201, in __call__
          loss_value = loss_obj(y_t, y_p, sample_weight=sw)
      File &quot;/usr/local/lib/python3.7/dist-packages/keras/losses.py&quot;, line 141, in __call__
          losses = call_fn(y_true, y_pred)
      File &quot;/usr/local/lib/python3.7/dist-packages/keras/losses.py&quot;, line 245, in call  **
          return ag_fn(y_true, y_pred, **self._fn_kwargs)
      File &quot;/usr/local/lib/python3.7/dist-packages/keras/losses.py&quot;, line 1932, in binary_crossentropy
          backend.binary_crossentropy(y_true, y_pred, from_logits=from_logits),
      File &quot;/usr/local/lib/python3.7/dist-packages/keras/backend.py&quot;, line 5247, in binary_crossentropy
          return tf.nn.sigmoid_cross_entropy_with_logits(labels=target, logits=output)
  
      ValueError: `logits` and `labels` must have the same shape, received ((None, 4, 4, 1) vs (None,)).
  </code></pre>