Serve Tensorflow model without installing Tensorflow
Asked Answered
S

2

4

I have a trained model that I want to use in a python application, but I can't see any examples of deploying to production environment without installing TensorFlow or creating gRPC service. Is it possible at all? What is the right approach in this situation?

Sellingplater answered 15/9, 2016 at 15:4 Comment(2)
"Model" is a plain-text or binary description of a computational graph and a set of pre-computed parameters for this graph. How do you imagine to run the model without a library that implements operations of this graph?Dicarlo
Maybe with some sort of object serialization?Sellingplater
P
2

How do you want to serve it if not using TensorFlow itself or TensorFlow serving? Do you plan on reimplementing the TensorFlow operations to get the same semantics?

That said, with XLA there is now a way to compile a TensorFlow model into a binary which can be called from C++. See the documentation on tfcompile for an example.

Pliant answered 13/3, 2017 at 16:11 Comment(1)
Thanks. I didn't know this feature. The links should be tensorflow.org/performance/xla/tfcompileSellingplater
V
0

You can deploy a tensorflow model without tensorflow by using NVIDIA's TensorRT deep learning inference library, which is now compatible with tensorflow since version 3 of the library. It is tailored for inference so it is a very good choice if you fullfill its requirements.

However, it won't work for you if you plan to do inference on CPU or on a platform that is not supported by TensorRT (e.g. Windows).

Vahe answered 8/8, 2018 at 7:59 Comment(1)
loading the model needs tf tf.saved_model.loadSapowith

© 2022 - 2024 — McMap. All rights reserved.