Keras: How directly get BestModel, not by saving?

Created on 9 May 2018  路  3Comments  路  Source: keras-team/keras

As the title say, thank you!

Checkpoint the weights for best model

from keras.callbacks import ModelCheckpoint

checkpoint

filepath="weights.best.hdf5"
checkpoint = ModelCheckpoint(filepath, monitor='val_acc', verbose=1, save_best_only=True, mode='max')
callbacks = [checkpoint]

Fit the model

model.fit(X, Y, validation_split, epochs, batch_size, callbacks=callbacks, verbose=0)

All 3 comments

Are there anybody could HELP me? Really thanks!

Of course, we could save and load timely, the question is for the custom layer/model (not built-in), somwhat inconvenient, really expect your reply.

Any kind advices would be grateful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Imorton-zd picture Imorton-zd  路  3Comments

kylemcdonald picture kylemcdonald  路  3Comments

farizrahman4u picture farizrahman4u  路  3Comments

fredtcaroli picture fredtcaroli  路  3Comments

KeironO picture KeironO  路  3Comments