save and load keras.callbacks.History

前端 未结 3 1820
面向向阳花
面向向阳花 2021-02-08 03:13

I\'m training a deep neural net using Keras and looking for a way to save and later load the history object which is of keras.callbacks.History type. Here\'s the se

3条回答
  •  暖寄归人
    2021-02-08 03:41

    You can use Pandas to save the history object as a CSV file.

    import pandas as pd
    
    pd.DataFrame.from_dict(history_model_1.history).to_csv('history.csv',index=False)
    

    The JSON approach results in a TypeError: Object of type 'float32' is not JSON serializable. The reason for this is that the corresponding values in the history dictionary are NumPy arrays.

提交回复
热议问题