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 export tensorflow model #345

Closed
fsx950223 opened this issue Mar 4, 2020 · 2 comments
Closed

How to export tensorflow model #345

fsx950223 opened this issue Mar 4, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@fsx950223
Copy link
Contributor

Description

Could mode.pkl transfer to tensorflow model?
...

Environment information

OS: <your answer here>

$ pip freeze | grep tensor
# your output here

$ pip freeze | grep jax
# your output here

$ python -V
# your output here

For bugs: reproduction and error logs

# Steps to reproduce:
...
# Error logs:
...
@lukaszkaiser
Copy link
Contributor

We're working on code to make this work, keeping this issue to track.

@lukaszkaiser lukaszkaiser added the enhancement New feature or request label Apr 28, 2020
@lukaszkaiser
Copy link
Contributor

This is done, you can make a Keras layer from any Trax layer like here:
https://github.com/google/trax/blob/master/trax/trax2keras.py

It will transfer weights too. So when you have a Trax model, do:
model.init_from_file(...model.pkl)
keras_model = TraxKerasLayer(model)

Now you can use it as any Keras layer:

keras_model.build(...)
keras_model.save(...)

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

No branches or pull requests

2 participants