我尝试使用c ++ api测试tensorflow示例,如下所述:https://www.tensorflow.org/tutorials/image_recognition#usage_with_the_c_api
我能够从源代码安装tensorflow,但是当我想用以下代码构建示例时:bazel-bin/tensorflow/examples/label_image/label_image
我收到这个错误:
ERROR: /home/user/tensorflow_sources/tensorflow/tensorflow/examples/label_image/BUILD:14:1: Linking of rule '//t
ensorflow/examples/label_image:label_image' failed (Exit 1)
/usr/bin/ld: warning: libcudnn.so.6, needed by bazel-out/k8-opt/bin/_solib_local/_U_S_Stensorflow_Sexamples_Slabel_
Uimage_Clabel_Uimage___Utensorflow/libtensorflow_framework.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcufft.so.8.0, needed by bazel-out/k8-opt/bin/_solib_local/_U_S_Stensorflow_Sexamples_Slabe
l_Uimage_Clabel_Uimage___Utensorflow/libtensorflow_framework.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcurand.so.8.0, needed by bazel-out/k8-opt/bin/_solib_local/_U_S_Stensorflow_Sexamples_Slab
el_Uimage_Clabel_Uimage___Utensorflow/libtensorflow_framework.so, not found (try using -rpath or -rpath-link)
问题与此处描述的完全相同:https://github.com/tensorflow/tensorflow/issues/15029
但解决方案尚不清楚:
我需要配置LPATH以包含libcudnn.so的路径。虽然我 将lib放在标准位置。
这个LPATH变量是什么?这个图书馆的标准位置是什么?因为对我来说,实际上是/ usr / local / cuda
我尝试多次重新配置我的tensorflow安装,我将LD_LIBRARY_PATH导出到包含文件libcudnn.so.6的文件夹的正确路径,但这些解决方案都没有。
我的配置: