keras: how to save ...
Notifications
Clear all

keras: how to save the training history

RSS

(@anamika)
Noble Member
Joined: 1 year ago
Posts: 1381
13/05/2021 12:51 pm

I want to save the history to a file, in Keras I havemodel.fit

历史=model.fit(Q_train,W_train,
batch_size
=batch_size,
nb_epoch
=nb_epoch,
validation_data=(Q_t, W_test))


Quote
(@ganesh)
Noble Member
Joined: 1 year ago
Posts: 1362
13/05/2021 12:52 pm

You can try this code:

import json

历史=model.fit(Q_train, W_train, epochs=5, batch_size=batch_size,validation_split=0.1)

with open('myfile.json', 'w') as file:

json.dump(history.history, file)


ReplyQuote
Share:
Baidu