title: ValueError: Data cardinality is ambiguous. Make sure all arrays contain the same number of samples
body: <p>I am running the following code on Colab. This is a regression problem, where I want to generate 5 float values from each image of size 224 x 224. As per my understanding, to solve this problem, I should use fully connected networks with 5 nodes in the last layer. But doing so on keras gave me an error described below.</p>
  <pre><code>import keras, os
  import numpy as np
  from tensorflow.keras.models import Model
  from tensorflow.keras.optimizers import Adam
  from tensorflow.keras.layers import Dense, GlobalAveragePooling2D
  from tensorflow.keras.applications.inception_v3 import InceptionV3
  
  ## data_list = list of four 224x224 numpy arrays
  
  inception = InceptionV3(weights='imagenet', include_top=False)
  x = inception.output
  x = GlobalAveragePooling2D()(x)
  x = Dense(1024, activation='relu')(x)
  predictions = Dense(5, activation='relu')(x)
  
  y = [np.random.random(5),np.random.random(5),np.random.random(5),np.random.random(5)]
  
  model = Model(inputs=inception.input, outputs=predictions)
  opt = Adam(lr=0.001)
  model.compile(optimizer=opt, loss=&quot;mae&quot;)
  model.fit(data_list, y, verbose=0, epochs=100)
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>ValueError: Data cardinality is ambiguous:<br />
        x sizes: 224, 224, 224, 224 <br />
        y sizes: 5, 5, 5, 5 <br />
  Make sure all arrays contain the same number of samples.</p>
  </blockquote>
  <p>What could be going wrong?</p>