samjabrahams / tensorflow-on-raspberry-pi Goto Github PK
View Code? Open in Web Editor NEWTensorFlow for Raspberry Pi
License: Other
TensorFlow for Raspberry Pi
License: Other
For me at least, I needed:
wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/raw/master/bin/tensorflow-0.7.1-cp27-none-linux_armv7l.whl
When I use python3.4, I get the following error:
import tensorflow as tf
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
I don't get the error using python2.7
I'm trying to build TensorFlow
, but I get an error and I didn't find anything related to this.
The error log : http://pastebin.com/zUfP4xsP
Any help ?
I've retrained tensorflow inception classifier, using example code from official TensorFlow repository on my 64 bit desktop machine with over 80% accuracy. But when I copied over .pb and .txt files to PI I get around 30% accuracy. I've found a similar issue and that person suggested to retrain classifier on 32 bit raspberry PI, but after doing that I still get 30% accuracy.
Is there any way to fix that? Thanks in advance
Please provide the following information about your Raspberry Pi setup:
im following this blog post to build a robot: oreilly.com/learning/how-to-build-a-robot-that-sees-with-100-and-tensorflow . in their video, it shows inception/classification takes about 10 seconds, but running with this version of tensorflow, it runs in 50 seconds, seems way too slow. is it supposed to be so slowm, anything special to get inception to run faster?
Im on raspberry 3b.
Please provide the following information about your Raspberry Pi setup:
I trained a .pb and .txt on my laptop with 95% test accuracy. I also tested several images and get the correct output. But when I copy the .pb and .txt file to my raspberry pi and run classify.py. The output is completely wrong when given the same image, which is tested on my laptop correctly. In other words, the accuracy on raspberry pi is less than 30%(kind of like random pick).
Trained network on a different machine and load the .pb file and .txt file on raspberry pi to classify.
laptop: ubuntu
installed tensorflow: 0.9.0rc0 linux x64
Please provide the following information about your Raspberry Pi setup:
Looks like there is a typo in the line in file Guide.md
git checkout d5fb408d
I think it should be:
git checkout d5fb408d .
Attempting to run the code from the tutorial on tensorflow.org found here:
https://www.tensorflow.org/versions/r0.9/tutorials/tflearn/index.html
At the line:
classifier.fit(x=x_train, y=y_train, steps=200)
I get the error:
TypeError: DataType int64 for attr 'T' not in list of allowed values: float32, int32, qint8, quint8, qint32
I am running on a Pi3 on Raspbian GNU/Linux 8 (jessie)" with Python version 2.7.9
See this thread:
What the title says. New version released recently.
Trained a DNN on Ubuntu x86_64 using TensorFlow 0.11, moved the trained network on the RPi and tried to run it with 0.10, it gives nonsense results. I'm guessing this is due to differences between 0.11 and 0.10.
Tried to compile 0.11 on the RPi, but things have changed a little meanwhile, and the guide doesn't work so well anymore, I got a series of errors where there should have been none. I'll keep trying this weekend if I have time. I'll upload the wheel somewhere if I succeed.
Anyway, it's time for a general update to 0.11.
I installed your wheel on a Raspberry Pi3 (Raspbian, python2.7) using pip according to your instructions here. I confirmed that the install worked according to one of the basic hello tests on tensorflow.org. However, I could not find the pi_examples folder, found here, from the official tensorflow repository. Did I miss something or was this example folder omitted?
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
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 $
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 $
pi@raspberrypi:~/tf/protobuf $ ./autogen.sh
I found there is no /tensorflow/examples/image_retraining folder after I installed it on my raspberry pi. I'm wondering what I should do if I want to use it. Should I just copy the image_retraining folder to the
usr/local/lib/python2.7/dist-packages/tensorflow/examples/tutorials/
?
Or should I use bazel to build it?
Hello , First thank you for this great project !
I would like to know please if tensorflow use the GPu on the raspberry pi ?
Thanks you
The compile instructions for protobuf recommend to do this after clone:
git checkout v3.0.0-beta-3.3
Don't. Just use the current master. That specific version has lots of issues and protobuf compilation will fail on the latest Raspbian on RPi3.
Just use the master version of that repo, don't mess with versions.
I've followed the instructions for installation via pip.
everything seems to function without giving any error messages.
However, when i attempt to test run bazel, it returns "command not found".
What am I missing?
This is a fresh install of raspbian via the noobs installer on a Raspberry Pi 3.
I should add: I did attempt to do the non-pip long-form install. I can't seem to get that to complete when attempting to compile bazel. When I enter the ./compile.sh part it fails saying:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421)
at java.lang.StringBuilder.append(StringBuilder.java:136)
at sun.net.www.protocol.jar.Handler.parseContextSpec(Handler.java:207)
at sun.net.www.protocol.jar.Handler.parseURL(Handler.java:153)
at java.net.URL.(URL.java:615)
at java.net.URL.(URL.java:483)
at sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:922)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1007)
at sun.misc.URLClassPath.getResource(URLClassPath.java:212)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.tools.javac.main.Main.resourceMessage(Main.java:610)
at com.sun.tools.javac.main.Main.compile(Main.java:543)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
Google tells me this is a simply memory fix. Any ideas?
Full disclosure, I am relatively new to Python :)
Success.
A few things here - from a fresh Raspberry Pi3 install, you also need to install git, as well as the java JDK (I used Oracle)
You also need to change the Bazel minimum version in WORKSPACE under the main directory to:
check_version("0.2.0")
to get it to build. Not certain what happens when you don't revert to the version mentioned in the instructions. Could still work.
Also, I did turn on the flag to compile with 2 cores on the RPI3, and it worked fine. Again, not certain what the difference is in terms of compile time.
On graph accuracy, which some folks have complained about - when I used the release wheel (0.9.0) I was running into accuracy issues with graphs built w/ 0.10.0(basically, it didnt work at all), but after the native compile, the results between x64 Linux and RPI3 were identical.
I wonder why noone just releases the RPI wheel...would make things much easier.
Happy inferencing.
Hi,
In this link( https://github.com/samjabrahams/tensorflow-on-raspberry-pi/tree/master/benchmarks/inceptionv3), it lists the pi's Inception-v3 speed data. I have tried to install the android demo(https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android) on my android cell phone, it can complete a picture recognition only around 3sec. I don't thank my samsung S6's hardware without GPU is much faster than pi. I am really curious about that!
when I run this code 'mvn package' it show Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile (default-testCompile) on project protobuf-java: Compilation failure
Hi! First of all, many thanks for your work! Installation with pip on Pi 3 with Jessie worked without any issues. I first tried the Inception-v3 classification you provided and it worked very well. Now I am trying to get AlexNet working on the Oxford 17 flowers dataset. I have the following configuration:
input_layer = input_data(shape=[None, 224, 224, 3])
conv1 = conv_2d(input_layer, 96, 11, strides=4, activation='relu')
pool1 = max_pool_2d(conv1, 3, strides=2)
network = local_response_normalization(pool1)
conv2 = conv_2d(network, 256, 5, activation='relu')
pool2 = max_pool_2d(conv2, 3, strides=2)
network = local_response_normalization(pool2)
conv3 = conv_2d(network, 384, 3, activation='relu')
conv4 = conv_2d(conv3, 384, 3, activation='relu')
conv5 = conv_2d(conv4, 256, 3, activation='relu')
pool3 = max_pool_2d(conv5, 3, strides=2)
network = local_response_normalization(pool3)
fc1 = fully_connected(network, 4096, activation='tanh')
dropout1 = dropout(fc1, 0.5)
fc2 = fully_connected(dropout1, 4096, activation='tanh')
dropout2 = dropout(fc2, 0.5)
fc3 = fully_connected(dropout2, 2, activation='softmax')
network = regression(fc3, optimizer='momentum', loss='categorical_crossentropy',
learning_rate=0.01)
This was written using the TFLearn API, but I think it gives a good overview over the layers and configuration. This code is working on my desktop computer but fails with OOM error in the fully connected layers on the Pi. Reducing the fc layers doesn't give OOM error with 1024 instead of 4096. Unfortunately it is still not training but just quitting after building up the network.
Any ideas how to solve this? Isn't the loaded Inception graph bigger than AlexNet?
Hello
First of, thank you for the effort to get tensorflow working on the raspberry pi
The issue:
I followed your step by step instructions for "installing from pip" in the readme
https://github.com/samjabrahams/tensorflow-on-raspberry-pi/raw/master/bin/tensorflow-0.8.0-cp34-cp34m-linux_armv7l.whl
gave me an error 404 url not found, so I replaced it with
https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/bin/tensorflow-0.9.0rc0-py3-none-any.whl
unfortunately i get the following errors:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1198, in prepare_files
do_download,
File "/usr/lib/python3/dist-packages/pip/req.py", line 1376, in unpack_url
self.session,
File "/usr/lib/python3/dist-packages/pip/download.py", line 582, in unpack_http_url
unpack_file(temp_location, location, content_type, link)
File "/usr/lib/python3/dist-packages/pip/util.py", line 640, in unpack_file
unzip_file(filename, location, flatten=not filename.endswith(('.pybundle', '.whl')))
File "/usr/lib/python3/dist-packages/pip/util.py", line 510, in unzip_file
zip = zipfile.ZipFile(zipfp)
File "/usr/lib/python3.4/zipfile.py", line 937, in init
self._RealGetContents()
File "/usr/lib/python3.4/zipfile.py", line 978, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
I have googled a bit and tried out some "solutions" but they didn't work
Steps to Reproduce:
Well I really just followed the instructions... changing the url...
Hardware/Software Info:
Wow terrific work, has anyone tried to get tensor flow running in a docker container on the RPI. It would give some nice isolation and in our work, we use docker on arm extensively. In addition, it makes cross compilation easy as you can today run arm containers on linux (by installing qemu-user-static
) or Mac (with the new Docker for Mac) so you do not need to compile directly on the Pi. I can send you a link to a docker package and git repo that makes this a little easier, then people can do a docker pull
and get tensor flow on their pi without a big compile
I'm finding that your .whl has the following issues and here are the steps:
apt-get install docker qemu-user-static
which will give you the ability to cross compileresin/rpi-raspbian
is a minimal build so doesn't include things that you need. Specifically here is what I have found so far:apt-get install gcc fortran
At a minimum in the rpi-raspbian container. I'm not sure but it looks like you also need libatlas-base-dev as well, but I have not yet finished your .whl compilation. As a final note, instead of creating a swapfile on a device, you might want to use a file based swapfile, that makes things way easier, there is a package called dphys-swapfile, so then you can just mount your junk USB that you do not care about as a single file.
Is it possible to let conv net running on tensorflow to control autonomous driving RC car on Raspberry Pi?
I want to port tensorflow to a new arm64 board(https://www.96boards.org/products/ce/bubblegum96/), following your guide:
project# pip2 install tensorflow-0.9.0rc0-cp27-none-linux_armv7
tensorflow-0.9.0rc0-cp27-none-linux_armv7l.whl is not a supported wheel on this platform.
Storing debug log for failure in /root/.pip/pip.log
project# pip3 install tensorflow-0.9.0-py3-none-any.whl
Unpacking ./tensorflow-0.9.0-py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/local/lib/python3.4/dist-packages (fr)
Requirement already satisfied (use --upgrade to upgrade): protobuf==3.0.0b2 in /usr/local/lib/python3.4/dist-package)
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/local/lib/python3.4/dist-packages (fro)
Requirement already satisfied (use --upgrade to upgrade): wheel>=0.26 in /usr/local/lib/python3.4/dist-packages (fro)
Installing collected packages: tensorflow
Successfully installed tensorflow
Cleaning up...
root@linaro-alip:/project# python3
Python 3.4.2 (default, Oct 8 2014, 12:59:09)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
import tensorflow as tf
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/tensorflow/init.py", line 23, in
from tensorflow.python import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/init.py", line 48, in
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helpr
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: /usr/local/lib/python3.4/dist-packages/tensorflow/python/_pywrap_tensorflow.so: wrong ELF class: ELFCLA2
It seems the tensorflow doesn't be imported successfully.
Hello,
It looks that I could successfully install tensorflow on a raspberry pi...
pi@raspi:~ $ sudo pip3 install tensorflow-0.10.0-py3-none-any.whl
Unpacking ./tensorflow-0.10.0-py3-none-any.whl
Downloading/unpacking six>=1.10.0 (from tensorflow==0.10.0)
Downloading six-1.10.0-py2.py3-none-any.whl
Downloading/unpacking wheel>=0.26 (from tensorflow==0.10.0)
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB): 66kB downloaded
Downloading/unpacking protobuf==3.0.0b2 (from tensorflow==0.10.0)
Downloading protobuf-3.0.0b2-py2.py3-none-any.whl (326kB): 326kB downloaded
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/lib/python3/dist-packages (from tensorflow==0.10.0)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python3/dist-packages (from protobuf==3.0.0b2->tensorflow==0.10.0)
Installing collected packages: tensorflow, six, wheel, protobuf
Found existing installation: six 1.8.0
Not uninstalling six at /usr/lib/python3/dist-packages, owned by OS
Found existing installation: wheel 0.24.0
Not uninstalling wheel at /usr/lib/python3/dist-packages, owned by OS
Successfully installed tensorflow six wheel protobuf
Cleaning up...
...but when I run python3 and try to run...
import tensorflow
...it raises the following error:
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/tensorflow/init.py", line 23, in
from tensorflow.python import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/init.py", line 48, in
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
SystemError: initialization of _pywrap_tensorflow raised unreported exception
Here is my raspberry info:
pi@raspi:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2709
Revision : a02082
Serial : 00000000d3397c5e
pi@raspi:~ $ uname -a
Linux raspi 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux
pi@raspi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Thanks for any help!
the current stable tensorflow version is 0.9
Getting an error right before trying to compile tensorflow. Did some searching around and people have suggested that upgrading to bazel 0.3.1 seems to fix the issue but compiling for 0.3.1 has issues itself in raspberry pi but sam says a fix is coming in a few days:
Follow all steps until ./configure
Raspberry Pi + 16GB Swap
Please provide the following information about your Raspberry Pi setup:
ERROR: /home/pi/tf/tensorflow/tensorflow/tensorflow.bzl:636:21: syntax error at '=': expected expression.
ERROR: /home/pi/tf/tensorflow/tensorflow/tensorflow.bzl:711:1: nested functions are not allowed. Move the function to top-level.
ERROR: /home/pi/tf/tensorflow/tensorflow/tensorflow.bzl:739:1: nested functions are not allowed. Move the function to top-level.
ERROR: /home/pi/tf/tensorflow/tensorflow/tensorflow.bzl:773:1: nested functions are not allowed. Move the function to top-level.
ERROR: /home/pi/tf/tensorflow/tensorflow/tensorflow.bzl:776:1: nested functions are not allowed. Move the function to top-level.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension 'tensorflow/tensorflow.bzl' has errors.
I tried to build from source by following the tutorial. When I do bazel build, it shows me a warning:
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
I don't know whether this is going to be a problem.
Hi,
Can I install TensorFlow on the Pi zero.?
I tried "sudo pip2 install tensorflow-0.9.0-cp27-none-linux_armv7l.whl"
but it returned
tensorflow-0.9.0-cp27-none-linux_armv7l.whl is not a supported wheel on this platform.
Storing debug log for failure in /root/.pip/pip.log
Is it possible for Install tensorflow with Docker or C++?
thank you and regards,
Khoa
Hi,
I want to install tensorflow package on raspberry pi.
I was able to go through the first step: download of the package. But when trying to pip install it, I get the following error lines:
could not find any downloads that satisfy the requirements...
cleaning up ...
No distributions at all found for tensorflow-0.8.0rc0...
I tried both install with pip and pip2 without success.
Has anyone been facing that error, and was able to solve it?
Thanks.
JM
Hi Sam, I wanted to build from source and I"m getting this error while building the gradle:
FAILURE: Build failed with an exception.
Where:
Build file '/home/pi/tf/grpc-java/all/build.gradle' line: 29
What went wrong:
A problem occurred evaluating project ':grpc-all'.
A problem occurred configuring project ':grpc-benchmarks'.
Could not resolve all dependencies for configuration ':grpc-benchmarks:protobufToolsLocator_protoc'.
> Could not find protoc-linux-arm_32.exe (com.google.protobuf:protoc:3.0.0-beta-2).
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-2/protoc-3.0.0-beta-2-linux-arm_32.exe
BUILD FAILED
Very exciting development but I am running Jessie v8.0 wheel file downloads OK and have dependencies installed but on pip install get the 'not a supported wheel on this platform' message. see attached file. Any ideas?
I have been working my way through your excellent install instructions. At TensorFlow ./configure there is an extra question that is not documented
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] N
I was not sure so I answered N. Currently the compile is underway with no issues yet. Can you explain the cloud platform support configuration option.
My aim is to install magenta and possibly music21 and do some learning about the various capabilities. Running this on a RPI3 with latest Jessie so no real issues so far. I originally tried it using Jessie Lite but had quite a few problems so decided to use the full Jessie and so far your instructions work perfectly.
Thanks Claude
Hello , i would like to ask you please if the GPU in the raspberry is used by your Tensorflow wheel file ??
Thank you very much !!
Hi Sam,
Thank you for your answer for my previous question. I'm now trying to collect data and label them in order to train a tensorflow network. Do you mind to give me suggestions or steps on how to do that? All the previous tutorials I run was downloaded dataset from other links. What I want is to collect and label my own data to train tensorflow.
best,
Xu
[gmock-1.7.0.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of gmock-1.7.0.zip or
gmock-1.7.0.zip.zip, and cannot find gmock-1.7.0.zip.ZIP, period.
simple edit autogen.sh to change the link to download gmock-1.70 as this:
http://pkgs.fedoraproject.org/repo/pkgs/gmock/gmock-1.7.0.zip/073b984d8798ea1594f5e44d85b20d66/gmock-1.7.0.zip
Thanks for all the hard work everyone, I'm super happy to get TF running on such a lovely raspberry pi. I'm currently experimenting with TF-Slim and it seems that r0.10 is needed to run the library. When I run the command:
python -c "import tensorflow.contrib.slim as slim; eval = slim.evaluation.evaluate_once"
It complains of needed: AttributeError: 'module' object has no attribute 'evaluate_once'. I believe this is included in 0.10 and right now we're at 0.09? Is there any chance that we can get the upgrade on raspberry pi? TF slim makes creating and running models so much easier and I believe is the direction that tensorflow is headed towards for model scaling.
This may end up being be more of a question/discussion about the pi's limitations more so than a bug report but when running the Deep MNIST for Experts example (https://www.tensorflow.org/versions/r0.9/tutorials/mnist/pros/index.html) the pi3 runs out of resources during the evaluation step. I searched quite a bit looking for a solution to this and have found people say something to the effect of "use batches to evaluate" but that's about as much info as anybody says about the topic.
So is there a way to evaluate in batches instead of the example that does it all at once:
print("test accuracy %g"%accuracy.eval(feed_dict={ x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))
I have not been able to find this process defined anywhere and will likely need to implement this in pi applications due to it's limited resources on processing large data sets.
running on a Pi3 on Raspbian GNU/Linux 8 (jessie)" with Python version 2.7.9
Full Console error:
Traceback (most recent call last):
File "/home/pi/tensorflow/Tutorial2.py", line 114, in
x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 556, in eval
return _eval_using_default_session(self, feed_dict, self.graph, session)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3637, in _eval_using_default_session
return session.run(tensors, feed_dict)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 382, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 655, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 723, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 743, in _do_call
raise type(e)(node_def, op, message)
ResourceExhaustedError: OOM when allocating tensor with shape[10000,28,28,32]
[[Node: Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/cpu:0"](Reshape, Variable_2/read)]]
Caused by op u'Conv2D', defined at:
File "", line 1, in
File "/usr/lib/python2.7/idlelib/run.py", line 116, in main
ret = method(_args, *_kwargs)
File "/usr/lib/python2.7/idlelib/run.py", line 324, in runcode
exec code in self.locals
File "/home/pi/tensorflow/Tutorial2.py", line 74, in
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
File "/home/pi/tensorflow/Tutorial2.py", line 64, in conv2d
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 394, in conv2d
data_format=data_format, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2298, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1232, in init
self._traceback = _extract_stack()
Hello as I am trying to go through the installation process when I get to this part.
/configure --prefix=/usr > I get this current error > ./configure --prefix=/usr
./configure --prefix=/usr
bash: ./configure: No such file or directory
Please provide the following information about your Raspberry Pi setup:
Hi guys. Having installed on an RPI3 using PIP, I have copied the code from:
As could not find tensorflow directory, on executing:
python tfimage.py
I get the error below.
Please provide the following information about your Raspberry Pi setup:
Traceback (most recent call last):
File "tfimage.py", line 218, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
TypeError: run() got an unexpected keyword argument 'argv'
Release 0.9 got screwed up due to changes in the official master. Need a create a routine to properly test capabilities of RPi TensorFlow binaries.
/contrib/testing may be what we want.
Thank you for the instructions of building tensorflow on Pi. I have followed your instructions but now I am stuck at the step of building tensorflow.
I am using Raspberry Pi 2 Model B with an 8G formatted SD card + official release of NOOBS 1.9.0
( At the first attempt I used NOOBS 1.4.2 but encountered same issue mentioned in #5, it was not fixed with adding memory swap but fixed with reinstalling NOOBS 1.9.0 )
After I came to the step of finishing building bazel. I got my output/bazel with the size of 82612.
When I attached a 4G USB thumb for mem swap and try to build tensorflow, I got error message below:
ERROR: Loading of target '//tools/jdk:GenClass_deploy.jar' failed; build aborted: no such package 'tools/jdk': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
I've tried this to make a ~/.bazelrc
build --package_path %workspace%:/home/pi/tensorflow/tf/bazel/
fetch --package_path %workspace%:/home/pi/tensorflow/tf/bazel/
query --package_path %workspace%:/home/pi/tensorflow/tf/bazel/
but I got another error below:
ERROR: Loading of target '//tools/jdk:SingleJar_deploy.jar' failed; build aborted: no such package 'tools/jdk': BUILD file not found on package path.
ERROR: Loading failed; build aborted
I saw there is a post discussing about error message above but I got no hint with it.
When I want to re-build the Bazel, the Pi just told me there is no space left on device.
pi@raspberrypi:~/tensorflow/tf/bazel $ ./compile.sh
Building Bazel from scratch.............
Creating Bazel self-extracting archive...
zip -r -q package.zip A-server.jar build_interface_so build-runfiles client embedded_tools install_base_key java.version jdk.BUILD libblaze.jar libunix.so namespace-sandbox process-wrapper xcode-locator install_base_key java.version
zip I/O error: No space left on device
zip error: Output file write failure (write error on zip file)
pi@raspberrypi:~/tensorflow/tf/bazel $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 5.9G 5.2G 316M 95% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 0 463M 0% /dev/shm
tmpfs 463M 6.4M 457M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p6 63M 20M 44M 32% /boot
tmpfs 93M 0 93M 0% /run/user/1000
/dev/mmcblk0p5 30M 442K 28M 2% /media/pi/SETTINGS
I would like to know
Or could you put your bazel binary to somewhere?
Thank you.
After a few hours of trial & error, here is my update to the guide:
tensorflow-on-raspberry-pi/GUIDE.md
Step 2 Build Protobuf
git checkout d5fb408d
./autogen.sh : File Name has changed so I copied the latest autogen.sh file from gihub
Step 5. Compiling TensorFlow
git clone: --recurse-submodules https://github.com/tensorflow/tensorflow
git checkout v0.9.0
I was not unable to build bazel 0.3.1 that is required for tensorflow 0.10.0 (current release) so I had to downgrade to release 0.9. with git checkout v0.9.0
Odroid build (error compiling with --copt="-mfpu=neon" on Odroid)
bazel build -c opt --local_resources 1024,2.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package
Install
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
I had an error when trying to PIP from /tmp , so I copied file to ~/Downloads
sudo pip install ~/Downloads/tensorflow-0.9.0-cp27-none-linux_armv7l.whl
Hope this can be usefull :-)
--prefix=/usr
will mix these files with files managed by apt/dpkg. And it's not needed, really.
Just run ./configure
without any options. Then make install
will install in /usr/local
. And then do sudo ldconfig
and everything will be fine - the new libraries will be used by other apps.
I follow your step to install tensorflow on raspberry pi 2 - newest Raspbian
I have a trouble when building Bazel
./compile.sh
It shows that error
= new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:32: warning: Signal is internal proprietary API and may be removed in a future release
private static final Signal SIGINT = new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:34: warning: SignalHandler is internal proprietary API and may be removed in a future release
private SignalHandler oldHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: SignalHandler is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:44: warning: Signal is internal proprietary API and may be removed in a future release
public void handle(Signal signal) {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: Signal is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:55: warning: Signal is internal proprietary API and may be removed in a future release
Signal.handle(SIGINT, oldHandler);
^
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.jar.Manifest$FastInputStream.(Manifest.java:332)
at java.util.jar.Manifest$FastInputStream.(Manifest.java:327)
at java.util.jar.Manifest.read(Manifest.java:195)
at java.util.jar.Manifest.(Manifest.java:69)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:199)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:944)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:450)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.tools.javac.main.Main.resourceMessage(Main.java:610)
at com.sun.tools.javac.main.Main.compile(Main.java:543)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
Do u have any idea to solve this problems. I guess it maybe OutOfMemoryError. Should I do the swap memory first before compile Bazel.
Thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.