Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial_epoch value for fine-tuning #552

Open
Peco602 opened this issue May 22, 2023 · 0 comments
Open

initial_epoch value for fine-tuning #552

Peco602 opened this issue May 22, 2023 · 0 comments

Comments

@Peco602
Copy link

Peco602 commented May 22, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant