title: When using tensorflow' fit_generator method I get a weird error after the first two batches are correclty yielded
body: <p>I am using Keras with tensorflow 1.8.0. When I use the <code>fit_generator</code> method, I get the following error, even though the first two batches are yielded correctly:</p>
  
  <pre><code>Traceback (most recent call last):
    File "main_gpu.py", line 184, in &lt;module&gt;
      params, dataset, trainSet, validSet, modelDim, outPath, voicing, fftSize, seqNumber)
    File "/net/inavouable/u.anasynth/laffitte/Code/CNNforMelodyExtraction/modelLearning.py", line 188, in trainStatefull
      shuffle = False
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
      return func(*args, **kwargs)
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/engine/training.py", line 1426, in fit_generator
      initial_epoch=initial_epoch)
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/engine/training_generator.py", line 191, in fit_generator
      class_weight=class_weight)
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/engine/training.py", line 1214, in train_on_batch
      class_weight=class_weight)
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/engine/training.py", line 797, in _standardize_user_data
      sample_weight, feed_output_names)
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/engine/training_utils.py", line 198, in standardize_sample_weights
      'sample_weight')
    File "/u/formes/share/packages/Anaconda3/envs/tensorflow_gpu/lib/python3.6/site-packages/keras/engine/training_utils.py", line 157, in standardize_sample_or_class_weights
      if x_weight is None or len(x_weight) == 0:
  TypeError: object of type 'bool' has no len()
  </code></pre>
  
  <p>There must be an issue with my generator since it works fine when I use a "dummy" generator, but I can't get my head around what the error might be, especially with this cryptic error message.</p>