linux中tensorflow编译libtensorflow_cc.so

  • 从github下载源码
cd path_tensorflow/tensorflow
# 依赖等见 https://tensorflow.google.cn/install/install_sources
./configure
bazel build --config=monlithic :libtensorflow_cc.so
# 如果不加--config=monlithic,编译出来的库会导致cv::imread()为空
# 这样导入库时只需导入libtensorflow_cc.so,不再需要libtensorflow_framework.so

参考
https://www.cnblogs.com/hrlnw/p/7007648.html
https://github.com/tensorflow/tensorflow/issues/14267

你可能感兴趣的:(tensorflow)