yu4u / age-gender-estimation

Keras implementation of a CNN network for age and gender estimation
MIT License
1.46k stars 502 forks source link

How to re-traning when stop #142

Open nguoido opened 3 years ago

nguoido commented 3 years ago

I have run code "train.py". But I stop it. I wonder if I can how to re-train with the latest checkpoint? Please help me.

vjsyong commented 3 years ago

You can modify the training code by adding

model.load_weights(weight_file)

before

model.fit()

This will restore the weights from the checkpoint file, but do be aware of the learning rate as the original learning rate decays in the later epochs, so by restarting the training from epoch 0 with the already trained weights, you might have to make some modifications.