• tensorflow serving GPU编译问题


    编译gpu版本:bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow_serving/model_servers:tensorflow_model_server

    编译cpu版本:bazel build //tensorflow_serving/model_servers:tensorflow_model_server

    问题1:

    ERROR: no such target '@org_tensorflow//third_party/gpus/crosstool:crosstool': target 'crosstool' not declared in package 'third_party/gpus/crosstool' defined by /home/username/.cache/bazel/_bazel_jorge/2fd988219920b10e9ede8d3b5720f3d2/external/org_tensorflow/third_party/gpus/crosstool/BUILD.

    解决:

     1 export TF_NEED_CUDA=1
     2 export TF_NEED_GCP=1
     3 export TF_NEED_JEMALLOC=1
     4 export TF_NEED_HDFS=0
     5 export TF_NEED_OPENCL=0
     6 export TF_ENABLE_XLA=0
     7 export TF_CUDA_VERSION=8.0
     8 export TF_CUDNN_VERSION=5
     9 export TF_CUDA_COMPUTE_CAPABILITIES="3.5,5.2,6.1"
    10 export CUDA_TOOLKIT_PATH="/usr/local/cuda"
    11 export CUDNN_INSTALL_PATH="/usr/local/cuda"
    12 export GCC_HOST_COMPILER_PATH="/usr/bin/gcc"
    13 export PYTHON_BIN_PATH="/home/opt/anaconda/envs/py2/bin/python"
    14 export CC_OPT_FLAGS="-march=native"
    15 export PYTHON_LIB_PATH="/home/opt/anaconda/envs/py2/lib/python2.7/site-packages"
    16 
    17 cd tensorflow
    18 ./configure
    19 cd ..
    20 
    21 # Ref: https://github.com/tensorflow/serving/issues/318#issuecomment-283498443
    22 sed -i.bak 's/@org_tensorflow//third_party/gpus/crosstool/@local_config_cuda//crosstool:toolchain/g' tools/bazel.rc
    23 
    24 bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow_serving/model_servers:tensorflow_model_server

    详情:https://github.com/tensorflow/serving/issues/318

  • 相关阅读:
    SQL逻辑查询处理阶段
    将json字符串转换为json兑现
    JSTL核心标签库
    eclipse用4个空格代替Tab 每行80字符限制提示线显示空格
    MyEclipse8.6 性能优化
    jsp/servlet总结复习
    SQLServer之MERGE INTO
    as3效率提升
    让默认TextField更清晰地显示中文
    as3垃圾回收机制
  • 原文地址:https://www.cnblogs.com/zl1991/p/8664392.html
Copyright © 2020-2023  润新知