nicolas-ivanov / debug_seq2seq

[unmaintained] Make seq2seq for keras work
233 stars 86 forks source link

Why does not function 'save_model(nn_model)' work? #4

Closed nextdawn closed 8 years ago

nextdawn commented 8 years ago

I noticed the function 'save_model(nn_model)' in lib/nn_model/train.py doesn't work so far. It seems there is an example to save/load model using HDF5 and json:

json_string = model.to_json() open('my_model_architecture.json', 'w').write(json_string) model.save_weights('my_model_weights.h5') (elsewhere...) model = model_from_json(open('my_model_architecture.json').read()) model.load_weights('my_model_weights.h5')

Does the method work?

nicolas-ivanov commented 8 years ago

This method seems workable, however the normal procedure should also work after the latest fixes in seq2seq lib. You'd better upgrade seq2seq first and then try using conventional methods for saving and loading your model's weights.