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

How to save a trained model? #39

Open
akshit96 opened this issue Apr 3, 2018 · 6 comments
Open

How to save a trained model? #39

akshit96 opened this issue Apr 3, 2018 · 6 comments

Comments

@akshit96
Copy link

akshit96 commented Apr 3, 2018

How can I save a trained tffm for future predictions ?
The model object cannot be pickled due to thread.RLock type object and isn't json serializable either.

@akshit96 akshit96 changed the title Saving a trained model How to save a trained model? Apr 4, 2018
@geffy
Copy link
Owner

geffy commented Apr 10, 2018

Hi @akshit96,
it cannot be pickled right now (there is a PR about this, but I haven't merded in yet), but in example.ipynb there is an example of how to save/restore the model.

@lukashes
Copy link

Any ideas how to save model for tf serving? Examples provide only python model saving and loading. But I do not want to use python for already trained model.

@akshit96
Copy link
Author

You can save bias, weights, vectors in a file and calculate the prediction manually.

@lukashes
Copy link

According to this answer https://stackoverflow.com/a/47982699/1579570 it is does not seem easy.
May be better to use SavedModel inside?

@akshit96
Copy link
Author

I did by saving the weights and predicting manually in a java code. It worked.

@skymonkey
Copy link

This is what we do and it works fine.

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

4 participants