配置tensorflow部分参考:https://blog.csdn.net/XUTIAN1129/article/details/78997633

装完anaconda, source ~/.bashrc后, 可以直接 pip install tensorflow-gpu , 珍爱生命,远离bazel。但想要c/c++调用tf的时候远离不了,还是得bazel编译安装tf-gpu

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 

对于:

>>> import tensorflow as tf
/home/aimhabo/anaconda2/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters

重装numpy并没什么用,不过这警告暂时没啥实际负面效果。

 

Intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.:

在终端里调用python xxx.py之前,输入export LD_PRELOAD=libmkl_rt.so

 

 

opencv 中找不到 eigen:

1、sudo apt-get install libeigen3-dev

2、#include <Eigen/Dense>

3、 sudo cp -r  /usr/include/eigen3/Eigen  /usr/local/include/

4、WITH_EIGEN,remake opencv

 

expected nested-name-specifier before ' KAL_XXX' using KAL_XXX:

using XXX = YYY; 是c++11新标准,低版本g++改成typedef语法

 

注意获取时要用回归的办法获取引用的库,最后cp到include里的几步可以用建立软连接替代

编译tf: https://blog.csdn.net/rockingdingo/article/details/75452711    https://cloud.tencent.com/developer/article/1006405

C版tf: bazel build --config=monolithic //tensorflow:libtensorflow.so

C++版tf: bazel build --config=monolithic //tensorflow:libtensorflow_cc.so

有*.proto的情况下缺少*.pb.h: 安装protobuf,在tensorflow-r1.8目录下 protoc --cpp_out=tensorflow/core/protobuf/ tensorflow/core/protobuf/*.proto

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄