Skip to content

Instantly share code, notes, and snippets.

@jarutis
Created October 24, 2016 18:37
Show Gist options
  • Save jarutis/6c2934705298720ff92a1c10f6a009d4 to your computer and use it in GitHub Desktop.
Save jarutis/6c2934705298720ff92a1c10f6a009d4 to your computer and use it in GitHub Desktop.
Install Tensorflow Serving on Centos 7 (CPU)
sudo su
# Java
yum -y install java-1.8.0-openjdk-devel
# Build Esentials (minimal)
yum -y install gcc gcc-c++ kernel-devel make automake autoconf swig git unzip libtool binutils
# Extra Packages for Enterprise Linux (EPEL) (for pip, zeromq3)
yum -y install epel-release
# Python
yum -y install numpy python-devel python-pip
pip install --upgrade pip
# Other TF deps
yum -y install freetype-devel libpng12-devel zip zlib-devel giflib-devel zeromq3-devel
pip install grpcio_tools mock
# HTTP2 Curl
yum -y install libev libev-devel zlib zlib-devel openssl openssl-devel
pushd /var/tmp
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
sudo make install
echo '/usr/local/lib' > /etc/ld.so.conf.d/custom-libs.conf
ldconfig
popd
pushd /var/tmp
wget http://curl.haxx.se/download/curl-7.46.0.tar.bz2
tar -xvjf curl-7.46.0.tar.bz2
cd curl-7.46.0
./configure --with-nghttp2=/usr/local --with-ssl
make
make install
ldconfig
popd
# Bazel
pushd /var/tmp
wget https://github.com/bazelbuild/bazel/releases/download/0.3.2/bazel-0.3.2-installer-linux-x86_64.sh
chmod +x bazel-*
./bazel-*
export PATH=/usr/local/bin:$PATH
popd
# TF Serving
git clone --recurse-submodules https://github.com/tensorflow/serving
pushd serving
git checkout ec36a91d81e6cd844586eeffdfdc22f415f3b11e # commit used in build
pushd tensorflow
git checkout 4e8497dcdb7918082732c01cf777f3559fc8168b # commit used in build
PYTHON_BIN_PATH=/usr/bin/python PYTHON_LIB_PATH=/usr/lib64/python2.7/site-packages TF_NEED_GCP=0 TF_NEED_HDFS=0 TF_NEED_CUDA=0 ./configure
popd
bazel build -c opt //tensorflow_serving/model_servers:tensorflow_model_server
popd
@phuhung273
Copy link

I got error when i tried "PYTHON_BIN_PATH=/usr/bin/python PYTHON_LIB_PATH=/usr/lib64/python2.7/site-packages TF_NEED_GCP=0 TF_NEED_HDFS=0 TF_NEED_CUDA=0 ./configure"

./configure
/opt/serving/tensorflow /opt/serving/tensorflow
Configuration finished
Extracting Bazel installation...
................
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
...............
ERROR: package contains errors: tensorflow/contrib/tfprof/tools/tfprof.
ERROR: error loading package 'tensorflow/contrib/tfprof/tools/tfprof': Encountered error while reading extension file 'protobuf.bzl': no such package '@protobuf//': Error downloading from http://github.com/google/protobuf/archive/008b5a228b37c054f46ba478ccafa5e855cb16db.tar.gz to /root/.cache/bazel/_bazel_root/63bc662b7997fee52d5aa0a4b43a169e/external/protobuf: Downloaded file at /root/.cache/bazel/_bazel_root/63bc662b7997fee52d5aa0a4b43a169e/external/protobuf/008b5a228b37c054f46ba478ccafa5e855cb16db.tar.gz has SHA-256 of be787d476f8fbda86aaa8fef9054ba5ea66c8ab684f39beac48c6f4744eba0c2, does not match expected SHA-256 (2737ad055eb8a9bc63ed068e32c4ea280b62d8236578cb4d4120eb5543f759ab).

can some one give me solution

Did you find any solution to this error ?

@yycsu
Copy link

yycsu commented Apr 30, 2021

I got error when i tried "PYTHON_BIN_PATH=/usr/bin/python PYTHON_LIB_PATH=/usr/lib64/python2.7/site-packages TF_NEED_GCP=0 TF_NEED_HDFS=0 TF_NEED_CUDA=0 ./configure"

./configure
/opt/serving/tensorflow /opt/serving/tensorflow
Configuration finished
Extracting Bazel installation...
................
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
...............
ERROR: package contains errors: tensorflow/contrib/tfprof/tools/tfprof.
ERROR: error loading package 'tensorflow/contrib/tfprof/tools/tfprof': Encountered error while reading extension file 'protobuf.bzl': no such package '@protobuf//': Error downloading from http://github.com/google/protobuf/archive/008b5a228b37c054f46ba478ccafa5e855cb16db.tar.gz to /root/.cache/bazel/_bazel_root/63bc662b7997fee52d5aa0a4b43a169e/external/protobuf: Downloaded file at /root/.cache/bazel/_bazel_root/63bc662b7997fee52d5aa0a4b43a169e/external/protobuf/008b5a228b37c054f46ba478ccafa5e855cb16db.tar.gz has SHA-256 of be787d476f8fbda86aaa8fef9054ba5ea66c8ab684f39beac48c6f4744eba0c2, does not match expected SHA-256 (2737ad055eb8a9bc63ed068e32c4ea280b62d8236578cb4d4120eb5543f759ab).

can some one give me solution

I also have this error, can anyone help, stuck for two days.. please!!!@jarutis @sausax @amrithadevadiga @liujiabing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment