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

issue with converting the model from colab to tf.keras h5 model? #5

Open
behinoo opened this issue Jul 19, 2019 · 1 comment
Open

Comments

@behinoo
Copy link

behinoo commented Jul 19, 2019

It seems alot of people have been struggling with this, so I am posting this here as well in case anyone had any luck with this.
re-search/DocProduct#6
I tried to save the model with this code:

`from docproduct.models import MedicalQAModelwithBert

medical_qa_model = MedicalQAModelwithBert(
config_file=os.path.join(
pretrained_path, 'bert_config.json'),
checkpoint_file=os.path.join(pretrained_path, 'biobert_model.ckpt'))

medical_qa_model.save("model.h5")`

i am getting this error which suggest save_weights but in this case it doesnt work since we cant convert it to tflite later.

NotImplementedError: The savemethod requires the model to be a Functional model or a Sequential model. It does not work for subclassed models, because such models are defined via the body of a Python method, which isn't safely serializable. Consider usingsave_weights, in order to save the weights of the model.

Any one managed to save the h5?

@ganesh292
Copy link

Any update on this issue?

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