@菜鸟初学keras错误一 20190620
记录一下今天的错误
初次使用keras,不知道model.compile,不晓得model.fit,不懂的如何保存checkpoint等模型。
经过一番挣扎后发现,model相关的保存可以通过Modelcheckpoint()来保存
Modelcheckpoint介绍
原版可以看https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/ModelCheckpoint
tf.keras.callbacks.ModelCheckpoint
解释:
Class ModelCheckpoint
Inherits From: Callback
Defined in tensorflow/python/keras/callbacks.py.
Save the model after every epoch.
filepath can contain named formatting options, which will be filled the value of epoch and keys in logs (passed in on_epoch_end).
For example: if filepath is weights.{epoch:02d}-{val_loss:.2f}.hdf5, then the model checkpoints will be saved with the epoch number and the validation loss in the filename.
### Arguments:
1. filepath: string, path to save the model file.