编译TensorFlow-serving GPU版本
TensorFlow Serving 介绍
编译GPU版本
- 下载源码
git clone https://github.com/tensorflow/serving.git
- 创建镜像
nvidia-docker build --pull -t $USER/tensorflow-serving-devel -f serving/tensorflow_serving/tools/docker/Dockerfile.devel-gpu .
- 创建并进入容器
- 下载TensorFlow源码
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
git checkout v1.8.0 #检出v1.8.0
./configure
- 修改代码
vi tensorflow_serving/util/net_http/client/testing/BUILD
vi tensorflow_serving/util/net_http/server/testing/BUILD
添加cc_binary( ... linkopts = ["-lm"], )
https://github.com/tensorflow/serving/issues/971
- 编译
cd ..
bazel build -c opt --config=cuda tensorflow_serving/...