编译TensorFlow-serving GPU版本

编译TensorFlow-serving GPU版本

TensorFlow Serving 介绍

编译GPU版本

  1. 下载源码
    git clone https://github.com/tensorflow/serving.git
  2. 创建镜像
    nvidia-docker build --pull -t $USER/tensorflow-serving-devel -f serving/tensorflow_serving/tools/docker/Dockerfile.devel-gpu .
  3. 创建并进入容器
  4. 下载TensorFlow源码
    git clone https://github.com/tensorflow/tensorflow
    cd tensorflow
    git checkout v1.8.0 #检出v1.8.0
    ./configure
  5. 修改代码
    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
  6. 编译
    cd ..
    bazel build -c opt --config=cuda tensorflow_serving/...
posted @ 2018-07-28 21:47  WingPig99  阅读(1514)  评论(0编辑  收藏  举报