datastories-semeval2017-task4
datastories-semeval2017-task4 copied to clipboard
save model
Dear cbaziotis,
I was able to run all your code for the subtask A and then I saved the nn_model in a h5 file.
However, when I tried to load it with the following code:
from keras.models import load_model model = load_model('my_model2.h5')
I get "ValueError: Invalid layer: Attention"
If by chance you know how to solve this issue, I would really really appreciate
Thank you in advance
Matt
Hi Matt, Could you please pull from the master and try again?
Also, in case you are not aware of this, when loading a model with custom layers, you have to pass the layers' Class in load_model
. Look at this for an example https://github.com/cbaziotis/hierarchical-rnn-biocreative-4/blob/master/models/submissions/submission.py#L79
Please let me know if this solves your problem.