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

Serving models with custom op using tfgo #58

Open
JiahuaWU opened this issue Aug 10, 2021 · 2 comments
Open

Serving models with custom op using tfgo #58

JiahuaWU opened this issue Aug 10, 2021 · 2 comments

Comments

@JiahuaWU
Copy link

Hi, I trained a model with custom op and export it using saved_model API and I would like to serve it using tfgo. However, since tfgo binds to tensorflow C library(more precisely libtensorflow.so) which is very hard to modify, I'm not sure how to register the custom op in the binary in this case. Is there any chance and would anyone give some help?
Here is an example of training script in which dynamic_embedding is implemented as a custom op built in the library tensorflow-recommenders-addons, and when I try to load the model using tfgo I get the following error:

panic: Op type not registered 'TFRA>CuckooHashTableOfTensors' in binary running on CXJK8129239. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
@janpfeifer
Copy link

Same issue for TensorFlow Decision Forests models, they require TF custom ops.

@MatthewZholud
Copy link

Custom ops can be loaded using
tf.LoadLibrary(opFilePass)

For decision forest i found ops file here.
File path: /tensorflow_decision_forests/tensorflow/ops/inference/inference.so

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

3 participants