title: Keras: Method on_batch_end() is slow but I have no callbacks?
body: <p>Keras just warned me:</p>
  
  <blockquote>
    <p>UserWarning: Method on_batch_end() is slow compared to the batch update (0.988304). Check your callbacks.</p>
  </blockquote>
  
  <p>I have no callbacks in my keras script, but I am using <code>DataGenerator</code> (<code>keras.utils.Sequence</code>). Could this be a problem?</p>
  
  <p>For the <code>DataGenerator</code>, I have implemented <code>__init__()</code>, <code>__len__()</code>, <code>__getitem()__</code>, and <code>on_epoch_end</code> methods.</p>
  
  <p>For <code>on_epoch_end</code>, I have:</p>
  
  <pre><code>def on_epoch_end(self):
      """
      This method will be called between every epoch, so we can shuffle the
      indexes here.
      """
      self.indexes = np.arange(len(self.image_names))
      if self.shuffle:
          np.random.shuffle(self.indexes)
  </code></pre>
  
  <p>The complete callstack is as below:</p>
  
  <blockquote>
    <p>Using TensorFlow backend.
    /var/lib/condor/execute/slot1/dir_30551/anaconda/envs/cellimage/lib/python3.6/site-packages/skimage/transform/_warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.</p>
    
    <p>warn("The default mode, 'constant', will be changed to 'reflect' in "
    /var/lib/condor/execute/slot1/dir_30551/anaconda/envs/cellimage/lib/python3.6/site-packages/keras/callbacks.py:120: UserWarning: Method on_batch_end() is slow compared to the batch update (0.586719). Check your callbacks.
      % delta_t_median)</p>
    
    <p>/var/lib/condor/execute/slot1/dir_30551/anaconda/envs/cellimage/lib/python3.6/site-packages/keras/callbacks.py:120: UserWarning: Method on_batch_end() is slow compared to the batch update (0.988304). Check your callbacks.
      % delta_t_median)</p>
  </blockquote>