简体   繁体   中英

Load epochs logs Keras model

I load the Keras model I have been training with 150 epochs

tbCallBack = tensorflow.keras.callbacks.TensorBoard(log_dir='./Graph', histogram_freq=0, write_graph=True, write_images=True)


my_model.fit(X_train, X_train,
                     epochs=200, 
                     batch_size=100,
                     shuffle=True,
                     validation_data = (X_test, X_test),
                     callbacks=[tbCallBack]
               )

# Save the model
my_model.save('my_model.hdf5')

Then, I will load the Keras model

my_model = load_model("my_model.hdf5")

Is there a way to load all the epochs logs (loss, accuracy.. )?

You can use the keras callback called CSVLogger .

According to the documentation , it streams the results from each epoch into a csv file.

This is the code from the documentation of it.

from keras.callbacks import CSVLogger

csv_logger = CSVLogger('training.log')
model.fit(X_train, Y_train, callbacks=[csv_logger])

You can then manipulate it as a normal CSV file, for your needs.

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