tensorflow-on-raspberry-pi
tensorflow-on-raspberry-pi copied to clipboard
FAILED: Build did NOT complete successfully
Describe the Issue
When the first time use bazel 0.4.5,it shows that i need higher version. So i changed to the newest version 0.11.1 but i didnot find **_Finally, we have to add one thing to tools/cpp/cc_configure.bzl - open it up for editing:
nano tools/cpp/cc_configure.bzl Place the line return "arm" around line 133 (at the beginning of the _get_cpu_value function):
... """Compute the cpu_value based on the OS name.""" return "arm" ..."_**
and
**Replace the following
native.new_http_archive( name = "eigen_archive", urls = [ "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", "https://bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", ], sha256 = "ca7beac153d4059c02c8fc59816c82d54ea47fe58365e8aded4082ded0b820c4", strip_prefix = "eigen-eigen-f3a22f35b044", build_file = str(Label("//third_party:eigen.BUILD")), )**
but i changed the tf.new_http_archive to what the guide says
Steps to Reproduce
Hardware/Software Info
MODEL 3B Bazel version:0.11.1 Please provide the following information about your Raspberry Pi setup:
- Raspberry Pi model:
- Operating System used: 3b
- Version of Python used: 3.5
- SD card memory size: 32
- Size of USB/other device used as swap (if building from source):16
- TensorFlow git commit hash (if building from source): git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git
Relevant Console Output/Logs
ERROR: /home/pi/tf/tensorflow/tensorflow/contrib/lite/toco/BUILD:392:1: Linking of rule '//tensorflow/contrib/lite/toco:toco' failed (Exit 1): gcc failed: error executing command
(cd /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/execroot/org_tensorflow &&
exec env -
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
PWD=/proc/self/cwd
PYTHON_BIN_PATH=/usr/bin/python3
PYTHON_LIB_PATH=/usr/local/lib/python3.5/dist-packages
TF_DOWNLOAD_CLANG=0
TF_NEED_CUDA=0
TF_NEED_OPENCL_SYCL=0
/usr/bin/gcc -o bazel-out/arm-py3-opt/bin/tensorflow/contrib/lite/toco/toco '-Wl,-rpath,$ORIGIN/../../../../_solib_arm/_U_S_Stensorflow_Scontrib_Slite_Stoco_Ctoco___Utensorflow' -Lbazel-out/arm-py3-opt/bin/_solib_arm/_U_S_Stensorflow_Scontrib_Slite_Stoco_Ctoco___Utensorflow '-Wl,-rpath,$ORIGIN/,-rpath,$ORIGIN/..,-rpath,$ORIGIN/../..,-rpath,$ORIGIN/../../..' -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -pthread '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -B/usr/bin -pass-exit-codes -Wl,--gc-sections -Wl,@bazel-out/arm-py3-opt/bin/tensorflow/contrib/lite/toco/toco-2.params)
bazel-out/arm-py3-opt/bin/tensorflow/core/kernels/_objs/list_kernels/tensorflow/core/kernels/list_kernels.o:list_kernels.cc:function tensorflow::TensorListStack<Eigen::ThreadPoolDevice, tensorflow::bfloat16>::Compute(tensorflow::OpKernelContext*): error: undefined reference to 'void tensorflow::ConcatCPUtensorflow::bfloat16(tensorflow::DeviceBase*, std::vector<std::unique_ptr<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix, std::default_delete<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix> >, std::allocator<std::unique_ptr<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix, std::default_delete<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix> > > > const&, tensorflow::TTypes<tensorflow::bfloat16, 2, int>::Matrix*)'
collect2: error: ld returned 1 exit status
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 41707.941s, Critical Path: 7320.12s
FAILED: Build did NOT complete successfully
I found somewhere in the docs to edit nano tools/cpp/lib_cc_configure.bzl (precede the name by lib_). There you can add return "arm". I could find a reference to eigen, but that has a different sha256 signature. Your error seems to indicate that the eigen section should be replaced by something else. Any suggestions?
Can’t find place to edit arm in bazel 0.10 and higher. I tried to replace the eigen as the totirial says and i got these error
In paragraph 3 of the documentation you found that in tools/cpp/cc_configure.bzl, around line 133 in function get_cpu_value you have to add return "arm", like
...
"""Compute the cpu_value based on the OS name."""
return "arm"
...
The documenation continues: " In newer Bazel versions, the _get_cpu_value function will be found in the file tools/cpp/lib_cc_configure.bzl, and the same modification is required.". Using bazel 0.11.1 I found lib_cc_configure.bzl and you have to add that line in get_cpu_value, but somewhere earlier than line 133.
As for eigen, the documentation advises to change
native.new_http_archive(
name = "eigen_archive",
urls = [
"http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz",
"https://bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz",
],
sha256 = "ca7beac153d4059c02c8fc59816c82d54ea47fe58365e8aded4082ded0b820c4",
strip_prefix = "eigen-eigen-f3a22f35b044",
build_file = str(Label("//third_party:eigen.BUILD")),
)
But as you said, that line cannot be found. What can be found is:
tf_http_archive(
name = "eigen_archive",
urls = [
"https://mirror.bazel.build/bitbucket.org/eigen/eigen/get/6913f0cf7d06.tar.gz",
"https://bitbucket.org/eigen/eigen/get/6913f0cf7d06.tar.gz",
],
sha256 = "791b836cacd03e20bae5bdd25f1c4a5505a0a9975ba94a61eb4e2631fbd1d53a",
strip_prefix = "eigen-eigen-6913f0cf7d06",
build_file = clean_dep("//third_party:eigen.BUILD"),
patch_file = clean_dep("//third_party:eigen_fix_cuda_compilation.patch")
)
The sha256 signatures are different so I do not know by which to replace the occurrence above. That it is necessary is suggested by you error report. It appears that it gets stuck in something that has to do with eigen. So I hoped someone else had found a solution.
I am in the midst of a compilation right now (for already 4 hours). When I have results I will repport but that will not be within 18 hours I'm afraid.
@RnoldR Thanks for your help. I totally didnot saw that , my bad.
Today i'll also try this toturial again with a brandnew installed jessie use the latest bazel and tensorflow without changing the tf_http_archive to find out if it would work.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: no such package '@eigen_archive//': Traceback (most recent call last): File "/home/pi/tf/tensorflow/third_party/repo.bzl", line 88 _apply_patch(ctx, ctx.attr.patch_file) File "/home/pi/tf/tensorflow/third_party/repo.bzl", line 59, in _apply_patch _execute_and_check_ret_code(ctx, cmd) File "/home/pi/tf/tensorflow/third_party/repo.bzl", line 44, in _execute_and_check_ret_code fail("Non-zero return code({1}) when ...)) Non-zero return code(256) when executing 'patch -p1 -d /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/external/eigen_archive -i /home/pi/tf/tensorflow/third_party/eigen_fix_cuda_compilation.patch': Stdout: Stderr: Timed out INFO: Elapsed time: 355.783s FAILED: Build did NOT complete successfully (130 packages loaded)
After i changed the
tf_http_archive(
name = "eigen_archive",
urls = [
"http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz",
"https://bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz",
],
sha256 = "a34b208da6ec18fa8da963369e166e4a368612c14d956dd2f9d7072904675d9b",
strip_prefix = "eigen-eigen-d781c1de9834",
build_file = str(Label("//third_party:eigen.BUILD")),
)
output: pi@raspberrypi:~/tf/tensorflow $ bazel build -c opt --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package ...................................................... WARNING: /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/external/protobuf_archive/WORKSPACE:1: Workspace name in /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/external/protobuf_archive/WORKSPACE (@com_google_protobuf) does not match the name given in the repository's definition (@protobuf_archive); this will cause a build error in future versions ERROR: /home/pi/tf/tensorflow/tensorflow/tools/pip_package/BUILD:85:1: no such package '@swig//': java.io.IOException: Error downloading [https://mirror.bazel.build/ufpr.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz, http://ufpr.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz, http://pilotfiber.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz] to /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/external/swig/swig-3.0.8.tar.gz: Checksum was 8877b55841c65f4bb8299b533ca1fd046ca395bde801f32f1fef8c32ff7c6653 but wanted 58a475dbbd4a4d7075e5fe86d4e54c9edde39847cdb96a3053d87cb64a23a453 and referenced by '//tensorflow/tools/pip_package:licenses' ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: no such package '@swig//': java.io.IOException: Error downloading [https://mirror.bazel.build/ufpr.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz, http://ufpr.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz, http://pilotfiber.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz] to /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/external/swig/swig-3.0.8.tar.gz: Checksum was 8877b55841c65f4bb8299b533ca1fd046ca395bde801f32f1fef8c32ff7c6653 but wanted 58a475dbbd4a4d7075e5fe86d4e54c9edde39847cdb96a3053d87cb64a23a453 INFO: Elapsed time: 221.695s FAILED: Build did NOT complete successfully (140 packages loaded) currently loading: tensorflow/core/kernels/neon
I came home to discover that the compilation failed due to RST_STREAM, err=8 (at package 3289). That seems to be an out of memory error. I cannot help you right now, sorry. I'll close all processes and start a new compilation. You might consider checking out an older version, I work with version r1.2.
@RnoldR I will try this some other time with version r1.2, thanks.
I tried again with the tensorflow/workspace.bzl like
tf_http_archive( name = "eigen_archive", urls = [ "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/d781c1de9834$ "https://bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", ], sha256 = "a34b208da6ec18fa8da963369e166e4a368612c14d956dd2f9d7072904675d9$ strip_prefix = "eigen-eigen-d781c1de9834", build_file = str(Label("//third_party:eigen.BUILD")), )
and bazel version 0.11.1 and git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git and the other all follow the toturial
output:
[4,758 / 4,766] 4 actions, 2 running
Linking tensorflow/contrib/lite/toco/toco; 25s local
Linking tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappersERROR: /home/pi/tf/tensorflow/tensorflow/contrib/lite/toco/BUILD:392:1: Linking of rule '//tensorflow/contrib/lite/toco:toco' failed (Exit 1): gcc failed: error executing command
(cd /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/execroot/org_tensorflow &&
exec env -
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
PWD=/proc/self/cwd
PYTHON_BIN_PATH=/usr/bin/python3
PYTHON_LIB_PATH=/usr/local/lib/python3.5/dist-packages
TF_DOWNLOAD_CLANG=0
TF_NEED_CUDA=0
TF_NEED_OPENCL_SYCL=0
/usr/bin/gcc -o bazel-out/arm-py3-opt/bin/tensorflow/contrib/lite/toco/toco '-Wl,-rpath,$ORIGIN/../../../../_solib_arm/_U_S_Stensorflow_Scontrib_Slite_Stoco_Ctoco___Utensorflow' -Lbazel-out/arm-py3-opt/bin/_solib_arm/_U_S_Stensorflow_Scontrib_Slite_Stoco_Ctoco___Utensorflow '-Wl,-rpath,$ORIGIN/,-rpath,$ORIGIN/..,-rpath,$ORIGIN/../..,-rpath,$ORIGIN/../../..' -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -Wl,-z,notext -pthread '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -B/usr/bin -pass-exit-codes -Wl,--gc-sections -Wl,@bazel-out/arm-py3-opt/bin/tensorflow/contrib/lite/toco/toco-2.params)
[4,758 / 4,766] 4 actions, 2 running
Linking tensorflow/contrib/lite/toco/toco; 25s local
Linking tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappersbazel-out/arm-py3-opt/bin/tensorflow/core/kernels/_objs/list_kernels/tensorflow/core/kernels/list_kernels.o:list_kernels.cc:function tensorflow::TensorListStack<Eigen::ThreadPoolDevice, tensorflow::bfloat16>::Compute(tensorflow::OpKernelContext*): error: undefined reference to 'void tensorflow::ConcatCPUtensorflow::bfloat16(tensorflow::DeviceBase*, std::vector<std::unique_ptr<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix, std::default_delete<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix> >, std::allocator<std::unique_ptr<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix, std::default_delete<tensorflow::TTypes<tensorflow::bfloat16, 2, int>::ConstMatrix> > > > const&, tensorflow::TTypes<tensorflow::bfloat16, 2, int>::Matrix*)'
collect2: error: ld returned 1 exit status
[4,758 / 4,766] 4 actions, 2 running
Linking tensorflow/contrib/lite/toco/toco; 25s local
Linking tensorflow/contrib/tensor_forest/hybrid/gen_training_ops_py_wrappersTarget //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 39176.928s, Critical Path: 3998.50s
FAILED: Build did NOT complete successfully
Any news in this? I have the same error, and also the same doubt on what to do in the step of changing the eigen version dependency since it is different to what is shown in the tutorial.
Thanks!
Alas, no. I have given up for now. Next week a new Linux Format/Magazine (one of these two) appears with just that topic addressed. I'll try that and report on that.
I posted a comment into #120 for TensorFlow 1.9.0.