我在Ubuntu 16.04上,並且試圖根據this從源代碼構建支持GPU的TensorFlow。一切工作正常,直到「構建TensorFlow」步驟,其中我執行:在Ubuntu 16.04 w/GPU上構建TensorFlow源代碼:`GLIBCXX_3.4.20'找不到
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
編譯命中誤差與輸出:
ERROR: /home/thomas/tensorflow/tensorflow/core/BUILD:978:28: Executing genrule //tensorflow/core:proto_text_srcs_all failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions: /home/thomas/anaconda2/lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions)
bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions: /home/thomas/anaconda2/lib/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions)
bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions: /home/thomas/anaconda2/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions)
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
我的懷疑是錯誤有事情做與蟒蛇因爲bazel似乎在從〜/ anaconda2/lib中尋找libstdC++。
重新讀你的問題,我意識到我得到的錯誤只是當試圖在python中導入tensorflow,而不是在安裝時(我昨天做過,不記得這樣的錯誤)。無論如何,我認爲這些步驟值得一試 – florentbuisson
對我來說,它幫助設置庫路徑指向Anaconda庫文件夾:LD_LIBRARY_PATH = $ HOME/anaconda2/lib:$ LD_LIBRARY_PATH或LD_LIBRARY_PATH = $ HOME/anaconda3/lib:$ LD_LIBRARY_PATH爲anaconda3 reprasctively – Max