0
votes

Suppose, I have a model that is already trained with 100 epoch. I tested the model with test data and the performance is not satisfactory. So I decide to train for another 100 epoch. How can I do that?

I trained with model.fit(data, target, epochs=100, batch_size=batch_size)

Now I want to train the same model without adding new data for another 100 epoch. How can I do that?

2

2 Answers

1
votes

Simply call model.fit(data, target, epochs=100, batch_size=batch_size) again to carry on training the same model. model needs to be the same model object as in the initial training, not re-compiled.

0
votes

From Keras webpage:

Use model.save() to export your model in HDF5 format.

Later, import the model using keras.models.load_model().

Then you can always model.fit() any saved / imported model to continue the training with either new samples when they become available or extra epochs on the previous training dataset.