aditya1503 / Siamese-LSTM

Siamese Recurrent Neural network with LSTM for evaluating semantic similarity between sentences.
200 stars 68 forks source link

Missed the function of saving the new training model #9

Open liuenda opened 8 years ago

liuenda commented 8 years ago

Hi. Here is some suggestion about your code. Although in the example3.py, it seems you intend to train a new model with the new file name "new.p" but in the end, this "new.p" will never be created or saved. If possible, could do please add the function within several lines to make the new model to be saved after a new training process. I am also working on it but it seems still need more time for me. Just a suggestion. If possible, I am expecting to see your new version.

Thank you very much!

jnAILab commented 7 years ago

I also don't solve this problem.....

jonzarecki commented 6 years ago

Saving the model with pickle basically works, you just need to enlarge the recursion limit in python for it.

sys.setrecursionlimit(5000)  # avoid limit-exceeded when pickling
pickle.dump(sls, open("newp.p", "wb"))  # sls is the model object from example3.py

Also the saving method used in bestsem.p is available in my fork https://github.com/yonilx/LSTM-Sentence-Similarity