Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save model #3

Open
Matt2121rt opened this issue Oct 16, 2017 · 1 comment
Open

save model #3

Matt2121rt opened this issue Oct 16, 2017 · 1 comment

Comments

@Matt2121rt
Copy link

Matt2121rt commented Oct 16, 2017

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

@cbaziotis
Copy link
Owner

cbaziotis commented Jun 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants