tensorflow1.11
bazel 0.15.2
protobuf 3.6.0
eigen 3.3.5
wget -t 0 -c https://github.com/eigenteam/eigen-git-mirror/archive/3.3.5.zip unzip 3.3.5.zip cd eigen-git-mirror-3.3.5/ mkdir build cd build cmake .. make sudo make install
编译tensorflow
./configure
我需要的是CPU环境调用 所以一路都是NO
有显卡的执行 sudo bazel build --config=opt --config=cuda //tensorflow:libtensorflow_cc.so
没有显卡的执行 sudo bazel build --config=opt //tensorflow:libtensorflow_cc.so
编译成功以后复制一些头文件
mkdir /usr/local/include/tf
cp -r bazel-genfiles/ /usr/local/include/tf/
cp -r tensorflow /usr/local/include/tf/
cp -r third_party /usr/local/include/tf/
cp bazel-bin/tensorflow/libtensorflow_cc.so /usr/local/lib/
cp bazel-bin/tensorflow/libtensorflow_framework.so /usr/local/lib
参考链接