title: "ValueError: If your data is in the form of a Python generator, you cannot use `validation_split`." in Tensorflow Keras
body: <p>I am following <a href="https://www.tensorflow.org/tutorials/images/hub_with_keras" rel="nofollow noreferrer">this example</a> to train the model on my own categories and using validation_split in model.fit() to see the validation accuracy. Here is the code:</p>
  
  <pre><code>model.fit((item for item in image_data), epochs=30, 
                  steps_per_epoch=steps_per_epoch,callbacks = [batch_stats], validation_split=0.33)    
  </code></pre>
  
  <p>Doing so I am getting the following error</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\admin\Desktop\phd python projects\tensorflow_img_class\src\tensorflow_img_class.py", line 65, in &lt;module&gt;
      steps_per_epoch=steps_per_epoch,callbacks = [batch_stats], validation_split=0.33)    
    File "C:\Python37\lib\site-packages\tensorflow\python\keras\engine\training.py", line 758, in fit
      y, sample_weight, validation_split=validation_split)
    File "C:\Python37\lib\site-packages\tensorflow\python\keras\engine\training_utils.py", line 955, in check_generator_arguments
      raise ValueError('If your data is in the form of a Python generator, '
  ValueError: If your data is in the form of a Python generator, you cannot use `validation_split`.
  </code></pre>
  
  <p>I am not able to find the solution for this error. How can I see the validation scores without loading validation data from separate directory? I want my original training data to be get spitted for the purpose of validation. Is it possible? What are the other options?</p>
  
  <p>UPDATE
  After following the solution fron KRUXX I am getting this error after it runs for first epoch which points to the model.fit line</p>
  
  <pre><code>ValueError: Error when checking input: expected lambda_input to have shape (224, 224, 3) but got array with shape (256, 256, 3)
  </code></pre>