运行 命令 "bazel build tensorflow/examples/image_retraining:retrain" 时构建失败
Failed to build when run command "bazel build tensorflow/examples/image_retraining:retrain"
我正在尝试在 Ubuntu 14.04 LTS 和 python 2.7 上构建 tensorflow,没有 GPU。当我 运行 在终端上执行以下命令时 tutorial:
bazel build tensorflow/examples/image_retraining:retrain
它说无法使用日志构建:
ERROR: /home/yuan/tensorflow_source/tensorflow/tensorflow/python/BUILD:1826:1: Linking of rule '//tensorflow/python:_pywrap_tensorflow.so' failed: gcc failed: error executing command
(cd /home/yuan/.cache/bazel/_bazel_yuan/e5b8b6538ba16bbae5b1e0f5c26b7a12/execroot/tensorflow && \
exec env - \
/usr/bin/gcc -shared -o bazel-out/local-fastbuild/bin/tensorflow/python/_pywrap_tensorflow.so -Wl,--version-script tensorflow/tf_version_script.lds -pthread -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,@bazel-out/local-fastbuild/bin/tensorflow/python/_pywrap_tensorflow.so-2.params): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/local-fastbuild/bin/tensorflow/core/libversion_lib.a(version_info.pic.o): In function `tf_git_version()':
version_info.cc:(.text+0x0): multiple definition of `tf_git_version()'
bazel-out/local-fastbuild/bin/tensorflow/core/libframework_internal.lo(version_info.pic.o):version_info.cc:(.text+0x0): first defined here
bazel-out/local-fastbuild/bin/tensorflow/core/libversion_lib.a(version_info.pic.o): In function `tf_compiler_version()':
version_info.cc:(.text+0xd): multiple definition of `tf_compiler_version()'
bazel-out/local-fastbuild/bin/tensorflow/core/libframework_internal.lo(version_info.pic.o):version_info.cc:(.text+0xd): first defined here
collect2: error: ld returned 1 exit status
Target //tensorflow/examples/image_retraining:retrain failed to build
INFO: Elapsed time: 52.885s, Critical Path: 34.63s
这是我的构建环境:
OS: Ubuntu 14.04 LTS 64 位带 RAM 12Gib
gcc 版本:4.8.4
python版本:2.7.6
巴泽尔版本:0.3.2
git tensorflow 源版本:v0.11.0rc0-1541-g3737ac3
有没有人知道如何解决这个错误?非常感谢!
@David 感谢您的帮助,看来我的 ./configure 结果与预期不符。
我通过以下步骤终于搭建成功了
将 tensorflow 源同步到 HEAD
运行 ./重新配置,如有错误参考this.
运行再次构建命令
bazel build tensorflow/examples/image_retraining:retrain
而且我的构建结果不会有错误。
我正在尝试在 Ubuntu 14.04 LTS 和 python 2.7 上构建 tensorflow,没有 GPU。当我 运行 在终端上执行以下命令时 tutorial:
bazel build tensorflow/examples/image_retraining:retrain
它说无法使用日志构建:
ERROR: /home/yuan/tensorflow_source/tensorflow/tensorflow/python/BUILD:1826:1: Linking of rule '//tensorflow/python:_pywrap_tensorflow.so' failed: gcc failed: error executing command
(cd /home/yuan/.cache/bazel/_bazel_yuan/e5b8b6538ba16bbae5b1e0f5c26b7a12/execroot/tensorflow && \
exec env - \
/usr/bin/gcc -shared -o bazel-out/local-fastbuild/bin/tensorflow/python/_pywrap_tensorflow.so -Wl,--version-script tensorflow/tf_version_script.lds -pthread -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,@bazel-out/local-fastbuild/bin/tensorflow/python/_pywrap_tensorflow.so-2.params): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/local-fastbuild/bin/tensorflow/core/libversion_lib.a(version_info.pic.o): In function `tf_git_version()':
version_info.cc:(.text+0x0): multiple definition of `tf_git_version()'
bazel-out/local-fastbuild/bin/tensorflow/core/libframework_internal.lo(version_info.pic.o):version_info.cc:(.text+0x0): first defined here
bazel-out/local-fastbuild/bin/tensorflow/core/libversion_lib.a(version_info.pic.o): In function `tf_compiler_version()':
version_info.cc:(.text+0xd): multiple definition of `tf_compiler_version()'
bazel-out/local-fastbuild/bin/tensorflow/core/libframework_internal.lo(version_info.pic.o):version_info.cc:(.text+0xd): first defined here
collect2: error: ld returned 1 exit status
Target //tensorflow/examples/image_retraining:retrain failed to build
INFO: Elapsed time: 52.885s, Critical Path: 34.63s
这是我的构建环境:
OS: Ubuntu 14.04 LTS 64 位带 RAM 12Gib
gcc 版本:4.8.4
python版本:2.7.6
巴泽尔版本:0.3.2
git tensorflow 源版本:v0.11.0rc0-1541-g3737ac3
有没有人知道如何解决这个错误?非常感谢!
@David 感谢您的帮助,看来我的 ./configure 结果与预期不符。
我通过以下步骤终于搭建成功了
将 tensorflow 源同步到 HEAD
运行 ./重新配置,如有错误参考this.
运行再次构建命令
bazel build tensorflow/examples/image_retraining:retrain
而且我的构建结果不会有错误。