Vgg16 fit hangs for few second after every epoch

I am running vgg16 fit on dogs cats redux sample and noticed that it reaches 792/800 in 20 seconds. But then it hangs for 10 seconds and shows completed. Why does it hang at the end always?

For the actual data it went to 100% at 7:22 seconds and then hanged for 3 minutes.

That’s the part where the model is evaluating itself on the validation set!

Actually, it completes 800/800 in your case, updates its weights for the final batch for the epoch and then tries predicting the labels of the validation set. After that, it compares the predictions it made with the validation set and uses it to compute the validation accuracy.

You can sort of catch this by the fact that you only see loss / accuracy while the training for the epoch is still going on… but there’s a val_loss / val_acc also as soon as the epoch is completed.

Is there a way to add progress bar for the validation part?

I’m afraid keras doesn’t support that yet.

I think this is because, though training takes a while, predictions are generally orders of magnitude faster. Since the validation set is supposed to be small anyway, it probably does not make sense to create a progress bar for this.

You can checkout the docs here; under fit section.
verbose can be used to change progress bar configuration.