Commit a2a45bbd authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

call ModelCheckpoint

parent f4148788
......@@ -109,14 +109,14 @@ def main():
checkpoint = ModelCheckpoint('models/model-{epoch:03d}.h5', monitor='val_loss', save_best_only=True, mode='auto')
# train the model
history = model.fit(X_train, y_train, epochs=EPOCHS, batch_size=BATCH_SIZE, validation_data=(X_validation, y_validation))
history = model.fit(X_train, y_train, epochs=EPOCHS, batch_size=BATCH_SIZE, validation_data=(X_validation, y_validation), callbacks=[checkpoint])
# evaluate the model
test_error, test_accuracy = model.evaluate(X_test, y_test)
print(f"Test error: {test_error}, test accuracy: {test_accuracy}")
# save the model
model.save(SAVE_MODEL_PATH)
# model.save(SAVE_MODEL_PATH)
show_graph(history)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment