简体   繁体   中英

Load and Check Total Loss / Validation accuracy of Keras Sequential Model

I didn't find any answers to the following question:

Is there a way to print the trained model accuracy, total model loss and model evaluation accuracy after loading the saved trained Keras model?

from keras.models import load_model
m = load_model.load("lstm_model_01.hd5") 

I checked all the callable methods of m but didn't find what I was looking for.

Model is really a graph with weights and that's all that gets saved. You have to evaluate the restored model on data to get predictions and from that you'll obtain an accuracy.

Pleas save your model fit results as follows:

history = model.fit(input_train, y_train,
                    epochs=10,
                    batch_size=128,
                    validation_split=0.2)

And use pickle to dump it (ie history) out. There you will see the training loss or validation accuracy from the model. You can load it back anytime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM