title: Keras: why does entire epoch take longer time when it shows all batches are complete?
body: <p>I am trying to train a VGG16 model and have 4k training samples and 2k validation samples.</p>
  
  <p><a href="https://i.stack.imgur.com/7DZ8r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7DZ8r.png" alt="enter image description here"></a></p>
  
  <p>In the above image, even though the first 134 batches get completed very fast, the last batch waits for a long time and finishes after ~8mins, which I think is taking too long. Is there something wrong that I am doing? Using the following to start the training process.</p>
  
  <p><code>model.compile(optimizer='rmsprop', loss='categorical_crossentropy',metrics=['accuracy'])</code></p>
  
  <p><code>model.fit_generator(train_generator, samples_per_epoch=4320, epochs=50, validation_data=validation_generator, nb_val_samples=2880)</code></p>