Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building tensorflow on Raspberry Pi 2 Model B #6

Closed
e-lin opened this issue Mar 30, 2016 · 3 comments
Closed

Building tensorflow on Raspberry Pi 2 Model B #6

e-lin opened this issue Mar 30, 2016 · 3 comments

Comments

@e-lin
Copy link

e-lin commented Mar 30, 2016

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

  • Are you using an 8G SD card on Pi for this purpose?
  • The size of your output/bazel

Or could you put your bazel binary to somewhere?
Thank you.

@samjabrahams
Copy link
Owner

@e-lin
First, to answer your questions:

  1. No, I'm using a 16 GB SD card.
  2. The total size of all cloned repositories (protobuf, bazel, and tensorflow) after compiling is 1.1 GB, with the Bazel repository taking up about 300 MB, and the binary itself is about 74 MB (75237124). It looks like you didn't end up with a complete binary.

After finishing the full installation process, there were close to 8 GB of memory used between the new binaries and Raspbian. I'd recommend trying with a larger SD card and seeing if it compiles properly. If you're still having issues, let me know and we can work through it together.

With regards to uploading the Bazel binary: unfortunately, distributing the Bazel binary is not quite as simple as just sending the one file, and I won't have the time to properly create a Bazel distribution for several weeks. Additionally, I'm working on building Bazel 0.2 for Raspberry Pi, and I'd like to wait until I accomplish that before working on a distribution. I actually should double check how easy it is to distribute this binary before claiming this. I'm pretty sure there's more to it than just sending the binary, but I'll look into it.

@e-lin
Copy link
Author

e-lin commented Mar 31, 2016

I changed to use a 32 GB SD card. The upshot was that I finished it all at one go.
Closing this now.

@e-lin e-lin closed this as completed Mar 31, 2016
@samjabrahams
Copy link
Owner

Glad to hear it's working now. I'll make a note in the guide to use a 16GB or larger SD card.

samjabrahams added a commit that referenced this issue Mar 31, 2016
In #6, it was discovered that a fresh install of Raspbian on an 8 GB SD
card does not leave enough space to compile all of the programs. This
change informs users to use a larger SD card.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants