tfgo
tfgo copied to clipboard
Serving models with custom op using tfgo
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.
Same issue for TensorFlow Decision Forests models, they require TF custom ops.
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