title: Error when checking model target: expected dense_24 to have shape...but got array with shape... in Keras
body: <p>I can't understand what this error message is trying to tell me.</p>
  
  <p>Looking at the summary of my model, I am looking at the last few layers . </p>
  
  <p><a href="https://i.stack.imgur.com/ZZ1sa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZZ1sa.png" alt="enter image description here"></a></p>
  
  <p>But when I fit my model, I get the this:  </p>
  
  <p><a href="https://i.stack.imgur.com/ww6pT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ww6pT.png" alt="enter image description here"></a></p>
  
  <p>I don't understand. If I read this closely, Keras seems to be saying, "I looked at the labels (targets) for the validation set, and sensibly, this made me think the last layer in your model should be shaped (None, 2). But, instead of actually getting a last layer shaped (None, 2) in the model, the layer consisted of an actual array. Which was of some other shape." </p>
  
  <p>This makes no sense.</p>
  
  <p>I think that I suspect that this error really should say, in general, is:  </p>
  
  <p><code>"ValueError: Error when checking model target: although dense_n has shape (x, y), the shape of the target, (a,b), in incompatible."</code> . </p>
  
  <p>Does anyone care to agree or disagree?  Thanks.</p>
  
  <p>(There's a similar question <a href="https://stackoverflow.com/questions/39335434/exception-error-when-checking-model-target-expected-dense-3-to-have-shape-non">here</a>, but not very helpful.)</p>