callbacks需要是个list,加载fit里面。只有一个参数就可以了,也可以调整学习率的一些参数。
checkpoint = ModelCheckpoint(filepath=filepath,
monitor='val_acc',
verbose=1,
save_best_only=True)
callbacks = [checkpoint]
# Training.
model.fit(x_train, y_train,
batch_size=batch_size,
epochs=epochs,
verbose=1,
validation_data=(x_test, y_test),
callbacks=callbacks)