- 安装依赖
yum -y install automake libtool libsysfs libxslt-devel libffi libffi-devel python-devel gcc openssl openssl-devel sqlite-devel
pip install six numpy wheel coverage mock
pip install keras_applications==1.0.5 --no-deps
pip install keras_preprocessing==1.0.3 --no-deps
- 安装java
yum -y install java-1.8.0-openjdk*
- 安装Bazel
从https://github.com/bazelbuild/bazel/releases选择合适的版本,具体版本对应关系在https://tensorflow.google.cn/install/source,tensorflow r1.12对应的应是bazel 0.15.0
wget https://github.com/bazelbuild/bazel/releases/download/0.15.0/bazel-0.15.0-installer-linux-x86_64.sh
sh bazel-0.15.0-installer-linux-x86_64.sh --prefix=/usr/local/share/bazel
ln -s /usr/local/share/bazel/bin/bazel /usr/bin/bazel
- 下载TensorFlow
git clone https://github.com/tensorflow/tensorflow
或者
git clone https://jhc888007%40163.com:[password]@github.com/tensorflow/tensorflow
cd tensorflow
git checkout r1.12
- 编译
./configure
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg
- 安装
pip install tensorflow-1.12.0-cp27-cp27mu-linux_x86_64.whl
Centos 编译TensorFlow C/C++库 libtensorflow.so libtensorflow_framework.so
Centos C/C++库 libtensorflow.so libtensorflow_framework.so 测试
参考文献
https://blog.csdn.net/joshua2011/article/details/78546765