tensorflow-deep-learning
tensorflow-deep-learning copied to clipboard
initial_epoch value for fine-tuning
Looking at the following code it seems the model is being trained for 11 epochs and not 10:
# Fine tune for another 5 epochs
fine_tune_epochs = initial_epochs + 5
# Refit the model (same as model_2 except with more trainable layers)
history_fine_10_percent_data_aug = model_2.fit(train_data_10_percent,
epochs=fine_tune_epochs,
validation_data=test_data,
initial_epoch=history_10_percent_data_aug.epoch[-1], # start from previous last epoch
validation_steps=int(0.25 * len(test_data)),
callbacks=[create_tensorboard_callback("transfer_learning", "10_percent_fine_tune_last_10")])
Are you sure initial_epoch
should not be set to history_10_percent_data_aug.epoch[-1]+1
so the fine-tuning starts from epochs 6?
I think it actually suppose to stop at 9 because the first epoch is actually zero. 0 to 9 is 10 epochs