samjabrahams / tensorflow-on-raspberry-pi

TensorFlow for Raspberry Pi
Other
2.24k stars 496 forks source link

failed to build v0.9.0: ./tensorflow/core/kernels/sparse_matmul_op.h:75:11: error: cannot convert 'const type {aka const float}' to '__vector(4) __builtin_neon_sf' #40

Open alexryan opened 8 years ago

alexryan commented 8 years ago

Describe the Issue

everything works well up until I try to actually run bazel.

 pi@alexpi3:~/tf/tensorflow $ bazel build -c opt --copt="-mfpu=neon" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package

It builds for several hours before ultimately terminating with the error below ...

Is there a known tag or commit number that this has been verified to work with?

ERROR: /home/pi/tf/tensorflow/tensorflow/core/kernels/BUILD:973:1: C++ compilation of rule '//tensorflow/core/kernels:sparse_matmul_op' failed: gcc failed: error executing command 
  (cd /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/tensorflow && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-mfpu=neon' '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/protobuf -iquote bazel-out/local_linux-opt/genfiles/external/protobuf -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/farmhash_archive -iquote bazel-out/local_linux-opt/genfiles/external/farmhash_archive -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/highwayhash -iquote bazel-out/local_linux-opt/genfiles/external/highwayhash -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem external/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/external/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260 -isystem bazel-out/local_linux-opt/genfiles/external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/highwayhash -isystem bazel-out/local_linux-opt/genfiles/external/highwayhash -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-d02e6a705c30 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-d02e6a705c30 -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -pthread -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/sparse_matmul_op/tensorflow/core/kernels/sparse_matmul_op.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/sparse_matmul_op/tensorflow/core/kernels/sparse_matmul_op.pic.d -fPIC -c tensorflow/core/kernels/sparse_matmul_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/sparse_matmul_op/tensorflow/core/kernels/sparse_matmul_op.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from tensorflow/core/kernels/sparse_matmul_op.cc:20:0:
./tensorflow/core/kernels/sparse_matmul_op.h: In instantiation of 'Packet Eigen::internal::pload4bf16(const typename Eigen::internal::unpacket_traits<Packet>::type*) [with Packet = __vector(4) __builtin_neon_sf; typename Eigen::internal::unpacket_traits<Packet>::type = float]':
tensorflow/core/kernels/sparse_matmul_op.cc:260:42:   required from here
./tensorflow/core/kernels/sparse_matmul_op.h:75:11: error: cannot convert 'const type {aka const float}' to '__vector(4) __builtin_neon_sf' in return
   return *from;

...

Target //tensorflow/tools/pip_package:build_pip_package failed to build

Steps to Reproduce

I followed the steps of the tutorial precisely with one exception. I grabbed a specific version from git:

pi@alexpi3:~/tf/tensorflow $ git show-ref --tags -d
ba6e40fa22266ddcd97a4a7607066b29764d94e9 refs/tags/0.5.0
b2dc60eaa9c00421293b87824a2047fdcf6fa331 refs/tags/0.5.0^{}
436c97aaf3c94ab31d51d7ae05a2e5634481b3dd refs/tags/0.6.0
8242b4dd1b36440e191fef8a07b6f37d8bcee60d refs/tags/0.6.0^{}
c715c3102df1556fc0ce88fc987440a3c80e5380 refs/tags/v0.10.0
3cb39956e622b322e43547cf2b6e337020643f21 refs/tags/v0.10.0rc0
09e2e823bdbcb86542acef851c42754578be3f6c refs/tags/v0.6.0
d0db73a0648e3f1e8367606225e4df2f0d34d0c0 refs/tags/v0.7.0
028d0b46004c921acd48fdd0ec18128d79e18bf4 refs/tags/v0.7.1
4b7bc3174ed67b4a0eb1803537c9d00f132e9ae7 refs/tags/v0.8.0
31ea3dbf57d67b32ca1708e7d8cd5fb43e7810b1 refs/tags/v0.8.0rc0
25023dffcf88f46777b5ddab457ac84a5bed5d2f refs/tags/v0.9.0
9425f822d8a5dc657022eed5c5142b4bf7b1087a refs/tags/v0.9.0rc0

pi@alexpi3:~/tf/tensorflow $ git log --tags --decorate --simplify-by-decoration --oneline
c715c31 (tag: v0.10.0) Merge pull request #4284 from caisq/r0.10-fixes
3cb3995 (tag: v0.10.0rc0) Update Mac GPU setup instructions (#3575)
25023df (tag: v0.9.0) Merge pull request #2981 from caisq/r0.9-3
9425f82 (tag: v0.9.0rc0) Reorganize installation instructions
4b7bc31 (tag: v0.8.0) Update cuda instructions to be more specific about versions (#2065)
31ea3db (tag: v0.8.0rc0) switch docker links from b.gcr.io to gcr.io (#1911)
4aeebbb Merge branch 'skflow-master'
9e481da Initial commit
028d0b4 (tag: v0.7.1) Merge pull request #1213 from vrv/r0.7
d0db73a (tag: v0.7.0) Merge pull request #1116 from jendap/keep-numpy-version-in-pip.sh
09e2e82 (tag: v0.6.0) Change more 0.5 to 0.6
8242b4d (tag: 0.6.0) TensorFlow: some more python3 compatibility test fixes
b2dc60e (tag: 0.5.0) TensorFlow: Upstream changes to git.
f41959c TensorFlow: Initial commit of TensorFlow library. TensorFlow is an open source software library for numerical computation using data flow graphs.
pi@alexpi3:~/tf/tensorflow $ 

pi@alexpi3:~/tf/tensorflow $ **git checkout tags/v0.9.0**
Note: checking out 'tags/v0.9.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 25023df... Merge pull request #2981 from caisq/r0.9-3
pi@alexpi3:~/tf/tensorflow $ 

Hardware/Software Info

Please provide the following information about your Raspberry Pi setup:

...
external/eigen_archive/eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/src/util/EmulateArray.h: In static member function 'static void Eigen::internal::TensorExecutor<Expression, Eigen::ThreadPoolDevice, Vectorizable>::run(const Expression&, const Eigen::ThreadPoolDevice&) [with Expression = const Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<long long int, 1, 1, int>, 16>, const Eigen::TensorReductionOp<Eigen::internal::MaxReducer<long long int>, const Eigen::IndexList<Eigen::type2index<0> >, const Eigen::TensorMap<Eigen::Tensor<const long long int, 2, 1, int>, 16> > >; bool Vectorizable = false]':
external/eigen_archive/eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/src/util/EmulateArray.h:24:67: warning: array subscript is above array bounds [-Warray-bounds]
   EIGEN_STRONG_INLINE T& operator[] (size_t index) { return values[index]; }
                                                                   ^
external/eigen_archive/eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/src/util/EmulateArray.h:24:67: warning: array subscript is above array bounds [-Warray-bounds]
   EIGEN_STRONG_INLINE T& operator[] (size_t index) { return values[index]; }
                                                                   ^
external/eigen_archive/eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/src/util/EmulateArray.h: In static member function 'static void Eigen::internal::TensorExecutor<Expression, Eigen::ThreadPoolDevice, Vectorizable>::run(const Expression&, const Eigen::ThreadPoolDevice&) [with Expression = const Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<long long int, 1, 1, int>, 16>, const Eigen::TensorReductionOp<Eigen::internal::MaxReducer<long long int>, const Eigen::IndexList<Eigen::type2index<1> >, const Eigen::TensorMap<Eigen::Tensor<const long long int, 2, 1, int>, 16> > >; bool Vectorizable = false]':
external/eigen_archive/eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/src/util/EmulateArray.h:24:67: warning: array subscript is above array bounds [-Warray-bounds]
   EIGEN_STRONG_INLINE T& operator[] (size_t index) { return values[index]; }
                                                                   ^
external/eigen_archive/eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/src/util/EmulateArray.h:24:67: warning: array subscript is above array bounds [-Warray-bounds]
   EIGEN_STRONG_INLINE T& operator[] (size_t index) { return values[index]; }
                                                                   ^
ERROR: /home/pi/tf/tensorflow/tensorflow/core/kernels/BUILD:973:1: C++ compilation of rule '//tensorflow/core/kernels:sparse_matmul_op' failed: gcc failed: error executing command 
  (cd /home/pi/.cache/bazel/_bazel_pi/4770c5ca1786316d370c900c0b614a6d/tensorflow && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-mfpu=neon' '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/protobuf -iquote bazel-out/local_linux-opt/genfiles/external/protobuf -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/farmhash_archive -iquote bazel-out/local_linux-opt/genfiles/external/farmhash_archive -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/highwayhash -iquote bazel-out/local_linux-opt/genfiles/external/highwayhash -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem external/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/external/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260 -isystem bazel-out/local_linux-opt/genfiles/external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/highwayhash -isystem bazel-out/local_linux-opt/genfiles/external/highwayhash -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-d02e6a705c30 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-d02e6a705c30 -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -pthread -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/sparse_matmul_op/tensorflow/core/kernels/sparse_matmul_op.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/sparse_matmul_op/tensorflow/core/kernels/sparse_matmul_op.pic.d -fPIC -c tensorflow/core/kernels/sparse_matmul_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/sparse_matmul_op/tensorflow/core/kernels/sparse_matmul_op.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from tensorflow/core/kernels/sparse_matmul_op.cc:20:0:
./tensorflow/core/kernels/sparse_matmul_op.h: In instantiation of 'Packet Eigen::internal::pload4bf16(const typename Eigen::internal::unpacket_traits<Packet>::type*) [with Packet = __vector(4) __builtin_neon_sf; typename Eigen::internal::unpacket_traits<Packet>::type = float]':
tensorflow/core/kernels/sparse_matmul_op.cc:260:42:   required from here
./tensorflow/core/kernels/sparse_matmul_op.h:75:11: error: cannot convert 'const type {aka const float}' to '__vector(4) __builtin_neon_sf' in return
   return *from;
           ^
./tensorflow/core/kernels/sparse_matmul_op.h: In instantiation of 'Packet Eigen::internal::pload2bf16(const typename Eigen::internal::unpacket_traits<Packet>::type*) [with Packet = __vector(4) __builtin_neon_sf; typename Eigen::internal::unpacket_traits<Packet>::type = float]':
tensorflow/core/kernels/sparse_matmul_op.cc:265:42:   required from here
./tensorflow/core/kernels/sparse_matmul_op.h:82:11: error: cannot convert 'const type {aka const float}' to '__vector(4) __builtin_neon_sf' in return
   return *from;
           ^
./tensorflow/core/kernels/sparse_matmul_op.h: In instantiation of 'Packet Eigen::internal::pexpand_bf16_l(const Packet&) [with Packet = __vector(4) __builtin_neon_sf]':
tensorflow/core/kernels/sparse_matmul_op.cc:375:3:   required from here
./tensorflow/core/kernels/sparse_matmul_op.h:31:44: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return reinterpret_cast<const float&>(tmp);
                                            ^
./tensorflow/core/kernels/sparse_matmul_op.h:31:44: error: cannot convert 'const float' to '__vector(4) __builtin_neon_sf' in return
./tensorflow/core/kernels/sparse_matmul_op.h: In instantiation of 'Packet Eigen::internal::pexpand_bf16_u(const Packet&) [with Packet = __vector(4) __builtin_neon_sf]':
tensorflow/core/kernels/sparse_matmul_op.cc:376:3:   required from here
./tensorflow/core/kernels/sparse_matmul_op.h:40:44: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return reinterpret_cast<const float&>(tmp);
                                            ^
./tensorflow/core/kernels/sparse_matmul_op.h:40:44: error: cannot convert 'const float' to '__vector(4) __builtin_neon_sf' in return
./tensorflow/core/kernels/sparse_matmul_op.h: In function 'Packet Eigen::internal::pload2bf16(const typename Eigen::internal::unpacket_traits<Packet>::type*) [with Packet = __vector(4) __builtin_neon_sf; typename Eigen::internal::unpacket_traits<Packet>::type = float]':
./tensorflow/core/kernels/sparse_matmul_op.h:83:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
./tensorflow/core/kernels/sparse_matmul_op.h: In function 'Packet Eigen::internal::pexpand_bf16_l(const Packet&) [with Packet = __vector(4) __builtin_neon_sf]':
./tensorflow/core/kernels/sparse_matmul_op.h:32:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
./tensorflow/core/kernels/sparse_matmul_op.h: In function 'Packet Eigen::internal::pexpand_bf16_u(const Packet&) [with Packet = __vector(4) __builtin_neon_sf]':
./tensorflow/core/kernels/sparse_matmul_op.h:41:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
./tensorflow/core/kernels/sparse_matmul_op.h: In function 'Packet Eigen::internal::pload4bf16(const typename Eigen::internal::unpacket_traits<Packet>::type*) [with Packet = __vector(4) __builtin_neon_sf; typename Eigen::internal::unpacket_traits<Packet>::type = float]':
./tensorflow/core/kernels/sparse_matmul_op.h:76:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 9327.802s, Critical Path: 9192.88s
pi@alexpi3:~/tf/tensorflow $ 
samjabrahams commented 8 years ago

@alexryan - Thanks for opening this up. Let's try this: instead of checking out tag v0.9.0, checkout the branch r0.9 instead. There are a number of commits added to that branch after the release went gold, which you can see here (the commit you checked out was from June 21).

Let me know if that works (or doesn't), and we can move on from there!

alexryan commented 8 years ago

FYI ... no luck so far ...

I tried checking out the r0.9 branch.

pi@alexpi3:~/tf/tensorflow $ git checkout r0.9
Branch r0.9 set up to track remote branch r0.9 from origin.
Switched to a new branch 'r0.9'
pi@alexpi3:~/tf/tensorflow $ git branch
  master
* r0.9

I tried using the official 0.9 gzipped tar file ... pi@alexpi3:~/tf $ wget https://github.com/tensorflow/tensorflow/archive/v0.9.0.tar.gz

On both occassions I got the same error.

I tried updating raspbian with

sudo apt-get update
sudo apt-get upgrade

and bazel clean --expunge

But I continue to get this same error consistently.

samjabrahams commented 8 years ago

Thanks for letting me know. I'll reset a RPi to see if I can duplicate the error- it's possible that I missed a step somewhere.

alexryan commented 8 years ago

Thank you. I will continue trying to solve the problem as well.

Doing research on this particular error I see that you ran into an error within the same module ...

INFO: From Compiling tensorflow/core/kernels/argmax_op.cc:
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
ERROR: /home/pi/programming/tensorflow/tensorflow/core/kernels/BUILD:639:1: C++ compilation of rule '//tensorflow/core/kernels:argmax_op' failed: gcc failed: error executing command 
  (cd /home/pi/.cache/bazel/_bazel_pi/ddee419d9c6b5440629c2870bc1d9b2e/tensorflow && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-db7b61411772 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-db7b61411772 -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -pthread -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/argmax_op/tensorflow/core/kernels/argmax_op.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/argmax_op/tensorflow/core/kernels/argmax_op.d -c tensorflow/core/kernels/argmax_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/argmax_op/tensorflow/core/kernels/argmax_op.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4: gcc failed: error executing command 
  (cd /home/pi/.cache/bazel/_bazel_pi/ddee419d9c6b5440629c2870bc1d9b2e/tensorflow && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-db7b61411772 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-db7b61411772 -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -pthread -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/argmax_op/tensorflow/core/kernels/argmax_op.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/argmax_op/tensorflow/core/kernels/argmax_op.d -c tensorflow/core/kernels/argmax_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/argmax_op/tensorflow/core/kernels/argmax_op.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4.
Target //tensorflow/core/kernels:argmax_op failed to build
INFO: Elapsed time: 2301.254s, Critical Path: 1884.37s

https://github.com/tensorflow/tensorflow/issues/445

samjabrahams commented 8 years ago

That issue was caused by lack of RAM (hence the added swap USB drive). The 64GB drive you are using should be enough: could you run top on your RPi to double check that the swap is being recognized?

alexryan commented 8 years ago

indeed. swap space does seem to be working for me. here's a picture ... https://photos.google.com/share/AF1QipODqb7SXZRL5n61YB_D-3UhssVSY9CfT0NSV9VCKJG4D7Piq-0rf2ZARwEFQ2mgWQ?key=RmJDZjNKZUFvUFVKTlF4UEhOd1lXZzItZlI5ZEZB

alexryan commented 8 years ago

I got it to build by doing 2 things ...

1: I reduced the size of the swap partition from my entire drive (64GB) to a 2GB partition. The larger swap space seemed to cause the system to freeze up making the input devices and the monitor unusable and dropping ssh sessions. But reducing the size of the swap partition to be roughly twice the size of RAM seemed to fix that particular problem. I experienced the same issue building on odroid and using a smaller swap partition fixed the problem there as well.

2: To get rid of the error, I simply removed --copt="-mfpu=neon" from the bazel command.

BEFORE bazel build -c opt --copt="-mfpu=neon" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package

AFTER pi@alexpi3:~/tf/tensorflow $ bazel build -c opt --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package

York-Cheung commented 7 years ago

Oh hey,I'm faced the same ERROR in the same model as yours, when I followed @samjabrahams 's step by step build guide : https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md

Here's the error information:

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: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing. WARNING: /home/ubuntu/Downloads/tensorflow-master/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': Use SavedModel Builder instead. WARNING: /home/ubuntu/Downloads/tensorflow-master/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': Use SavedModel instead. INFO: Found 1 target... # ## ERROR: /home/ubuntu/Downloads/tensorflow-master/tensorflow/core/kernels/BUILD:1428:1: C++ compilation of rule '//tensorflow/core/kernels:lookup_table_op' failed: gcc failed: error executing command (cd /root/.cache/bazel/_bazel_root/e2fe563f358393641fa8be4bd4dec0c7/execroot/tensorflow-master && \ exec env - \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \ TF_NEED_CUDA=0 \ TF_NEED_OPENCL=0 \ /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-mfpu=neon-vfpv4' -funsafe-math-optimizations -ftree-vectorize -fomit-frame-pointer '-std=c++0x' -MD -MF bazel-out/local-opt/bin/tensorflow/core/kernels/_objs/lookup_table_op/tensorflow/core/kernels/lookup_table_op.pic.d '-frandom-seed=bazel-out/local-opt/bin/tensorflow/core/kernels/_objs/lookup_table_op/tensorflow/core/kernels/lookup_table_op.pic.o' -fPIC -DEIGEN_MPL2_ONLY -DSNAPPY -iquote . -iquote bazel-out/local-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -iquote external/eigen_archive -iquote bazel-out/local-opt/genfiles/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/local-opt/genfiles/external/local_config_sycl -iquote external/protobuf -iquote bazel-out/local-opt/genfiles/external/protobuf -iquote external/gif_archive -iquote bazel-out/local-opt/genfiles/external/gif_archive -iquote external/jpeg -iquote bazel-out/local-opt/genfiles/external/jpeg -iquote external/com_googlesource_code_re2 -iquote bazel-out/local-opt/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/local-opt/genfiles/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/local-opt/genfiles/external/fft2d -iquote external/highwayhash -iquote bazel-out/local-opt/genfiles/external/highwayhash -iquote external/png_archive -iquote bazel-out/local-opt/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/local-opt/genfiles/external/zlib_archive -iquote external/snappy -iquote bazel-out/local-opt/genfiles/external/snappy -iquote external/local_config_cuda -iquote bazel-out/local-opt/genfiles/external/local_config_cuda -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/eigen_archive -isystem bazel-out/local-opt/genfiles/external/eigen_archive -isystem external/protobuf/src -isystem bazel-out/local-opt/genfiles/external/protobuf/src -isystem external/gif_archive/lib -isystem bazel-out/local-opt/genfiles/external/gif_archive/lib -isystem external/farmhash_archive/src -isystem bazel-out/local-opt/genfiles/external/farmhash_archive/src -isystem external/png_archive -isystem bazel-out/local-opt/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/local-opt/genfiles/external/zlib_archive -isystem external/local_config_cuda/cuda -isystem bazel-out/local-opt/genfiles/external/local_config_cuda/cuda -isystem external/local_config_cuda/cuda/include -isystem bazel-out/local-opt/genfiles/external/local_config_cuda/cuda/include -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-DDATE="redacted"' '-DTIMESTAMP="redacted"' '-DTIME="redacted"' -c tensorflow/core/kernels/lookup_table_op.cc -o bazel-out/local-opt/bin/tensorflow/core/kernels/_objs/lookup_table_op/tensorflow/core/kernels/lookup_table_op.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4. gcc: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions. Target //tensorflow/tools/pip_package:build_pip_package failed to build INFO: Elapsed time: 28.552s, Critical Path: 26.12s

samjabrahams commented 7 years ago

@YorksonChang thanks for posting this. I'm going to be double checking the build instructions once TensorFlow 1.1.0 is finalized, and I'll report back here.