title: How to get x_train and y_train from ImageDataGenerator?
body: <p>I am working on some image classification problem and I made Y Network for it. Y Network is a type of Neural Network which has two inputs and one output. If we want to fit our Tensorflow model we have to feed x_train and y_train in model.fit().
  Like this -</p>
  <pre><code>model.fit([x_train, x_train], y_train, epochs=100, batch_size=64)
  </code></pre>
  <p>but how do I get <strong>x_train</strong> and <strong>y_train</strong> if I got my data from <strong>ImageDataGenerator</strong> ? Like this -</p>
  <pre><code>train_generator = train_datagen.flow_from_dataframe(... , batch_size=64, ...)
  </code></pre>
  <p>I tried getting x_train and y_train by this method:</p>
  <pre><code>x_train, y_train = train_generator.next()
  </code></pre>
  <p>but resulted x_train and y_train consist of only <strong>64</strong> images, I want all my <strong>8644</strong> images. I cannot increase batch_size to <strong>8644</strong> because it will need more memory and Google Colab will crash. What should I do ?</p>