keras: how to save the training history attribute of the history object

前端 未结 8 2062
小鲜肉
小鲜肉 2020-12-12 23:43

In Keras, we can return the output of model.fit to a history as follows:

 history = model.fit(X_train, y_train, 
                     batch_size         


        
8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 00:03

    What I use is the following:

        with open('/trainHistoryDict', 'wb') as file_pi:
            pickle.dump(history.history, file_pi)
    

    In this way I save the history as a dictionary in case I want to plot the loss or accuracy later on.

提交回复
热议问题