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 a pretrained model as .pb #22

Open
mvss80 opened this issue Jan 25, 2019 · 2 comments
Open

save a pretrained model as .pb #22

mvss80 opened this issue Jan 25, 2019 · 2 comments

Comments

@mvss80
Copy link

mvss80 commented Jan 25, 2019

Is there a way to export a trained model as .pb file that can be served with tensorflow serving?

@kermitt2
Copy link
Owner

hello @mvss80 !
Yes you can use for instance https://github.com/amir-abdi/keras_to_tensorflow which is exactly doing this with one command line.

@mvss80
Copy link
Author

mvss80 commented Jan 25, 2019

@kermitt2 thanks for the quick response and pointing me to the utility.

For the ner pretrained models, I can find the .hdf5 file with the weights but cannot find the network architecture .json file or the complete model .h5 files. Could you please let me know how I can export the network architecture so I can then export them both?

EDIT: I exported the model architecture as a .json file and also tried saving the model using model.save() that puts architecture+weights in one file. In both cases, the keras_to_tensorflow utility fails because looks like it doesn't support custom layers.

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