编译错误:: Bazel + TensorFlow。 pywrap_tensorflow_internal.py不存在或不存在常规文件

时间:2017-03-13 21:22:07

标签: compilation tensorflow

Bazel构建在Ubuntu上构建python包时崩溃。 完整报告:

sudo bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Tue Mar 14 02:41:24 IST 2017 : === Using tmpdir: /tmp/tmp.ZAETGIkAd2
~/git/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles
~/git/tensorflow
~/git/tensorflow
/tmp/tmp.ZAETGIkAd2 ~/git/tensorflow
Tue Mar 14 02:41:26 IST 2017 : === Building wheel
error: can't copy 'tensorflow/python/pywrap_tensorflow_internal.py': doesn't exist or not a regular file

我已经看到了早先提交的错误报告,并且在Ubuntu上安装了TensorFlow所需的swig。仍然是相同的错误日志。

系统详情

uname -a

Linux - 3.13.0-107-generic

2 个答案:

答案 0 :(得分:1)

这很可能不是build_pip_package命令的问题。我有一个失败的bazel build命令,我错误地忽略了它。

以下是错误日志:

ERROR: /home/annanay/.cache/bazel/_bazel_root/9b62c7240de3d9136528cdded945b550/external/llvm/BUILD:418:5: Generating code from table: lib/Target/AArch64/AArch64.td @llvm//:aarch64_target_gen__gen_fast_isel_genrule failed: bash failed: error executing command 
(cd /home/annanay/.cache/bazel/_bazel_root/9b62c7240de3d9136528cdded945b550/execroot/tensorflow && \
exec env - \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/external/llvm/llvm-tblgen -I external/llvm/include -I external/llvm/tools/clang/include -I $(dirname external/llvm/lib/Target/AArch64/AArch64.td) -gen-fast-isel external/llvm/lib/Target/AArch64/AArch64.td -o bazel-out/local-opt/genfiles/external/llvm/lib/Target/AArch64/AArch64GenFastISel.inc'): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
bazel-out/host/bin/external/llvm/llvm-tblgen: relocation error: bazel-out/host/bin/external/llvm/llvm-tblgen: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
Target //tensorflow/tools/pip_package:build_pip_package failed to build

答案 1 :(得分:0)

尝试从build目录更改为其他目录。 这对我有用。