Back
I want to save the history to a file, in Keras I have model.fit
history = model.fit(Q_train, W_train, batch_size=batch_size, nb_epoch=nb_epoch, validation_data=(Q_test, W_test))
You can save the model history by this:
with open('/trainHistoryDict', 'wb') as file_pi: pickle.dump(history.history, file_pi)
Happy Learning.
Want to learn AI? Read this extensive artificial intelligence tutorial!
You can try this code:
import jsonhistory = 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)
import json
history = 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)
31k questions
32.8k answers
501 comments
693 users