tensorflow / lattice

Lattice methods in TensorFlow
Apache License 2.0
518 stars 94 forks source link

Use Go binding to serve lattice #36

Closed cookid closed 4 years ago

cookid commented 5 years ago

I was trying to use TF's Go binding to serve Lattice model. My model loading go code is like: model, err = tf.LoadSavedModel(localModelDir, []string{"serve"}, nil) and I got following error:

Op type not registered 'PwlIndexingCalibrator' in binary running on myapp-5b4666d5f6-nmq7x. 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.

I realize there is a solution for tf-serving https://github.com/tensorflow/lattice/issues/19

I'm wondering if there is a similar solution for go binding?

mmilanifard commented 4 years ago

The new version of TF Lattice is based on core TF and does not use custom ops. It should be loadable within Go with tf.LoadSavedModel.