zzachimonde
zzachimonde

Reputation: 454

How could I build tensorflow-serving-api myself?

I have added some custom code in serving and I want to build my own tensorflow-serving-api for the customized serving, especially ReloadConfig API. But I have no idea how to build it myself. It seems that I could only install tensorflow-serving-api from pip. Any suggestions? Thanks.

Upvotes: 0

Views: 179

Answers (1)

Gautam Vasudevan
Gautam Vasudevan

Reputation: 406

Here's an example of how to do this:

# Pull the latest source code (or pick a release branch)
$ git clone https://github.com/tensorflow/serving .

# Make changes you'd want to make

# Build the pip package using the latest nightly docker build
$ tools/bazel_in_docker.sh bazel build --color=yes tensorflow_serving/tools/pip_package:build_pip_package

# Run the pip package builder using the latest nightly docker build
$ tools/bazel_in_docker.sh bazel-bin/tensorflow_serving/tools/pip_package/build_pip_package $(pwd)/pip

# Install the package that has your custom code
$ pip --no-cache-dir install --upgrade $(pwd)/pip/tensorflow_serving*.whl

# Clean up your extracted folder (optional)
$ rm -rf $(pwd)/pip

Upvotes: 1

Related Questions