This is the build environment I used to create a docker image for the Raspbery Pi which contains TensorFlow, Jupyter and two TensorFlow notebooks copied from the official Google docker tensorflow build.
The build relies heavily on the work of resin.io, Sam Abrahams and the Google TensorFlow team. Sources are listed below.
This is not an official TensorFlow port, so don't ask for or expect support from the TensorFlow team.
I've done a little testing. I have tried the build and run the image on a Raspberry Pi Model 3B with Raspbian Jessie.
- Install Docker on your Raspberry Pi.
curl -sSL http://downloads.hypriot.com/docker-hypriot_1.10.3-1_armhf.deb >/tmp/docker-hypriot_1.10.3-1_armhf.deb
sudo dpkg -i /tmp/docker-hypriot_1.10.3-1_armhf.deb
rm -f /tmp/docker-hypriot_1.10.3-1_armhf.deb
sudo sh -c 'usermod -aG docker $SUDO_USER'
sudo systemctl enable docker.service
- Clone this repository into a directory of your choice
git clone https://github.com/romilly/rpi-docker-tensorflow.git
- Build the image
cd rpi-docker-tensorflow/build-tensor-pi/
docker build -t='yourName/rpi-docker-tensorflow' .
This run instruction expects a directory called myNotebooks within your home directory.
If you save an IPython notebook to the myNotebooks
sub-directory
while running your container, it will get saved to the myNotebooks
directory on your Pi.
Notebooks saved to that directory will be persistent - in other words, they will still be there when the container is stopped and restarted.
docker run -it -p 8888:8888 -v ~/myNotebooks:/notebooks/myNotebooks yourName/rpi-docker-tensorflow
Previously there were some spurious warnings when the container started but the latest resin image fixes these. (Thanks, resinators!)
You can probably ignore the warnings about the insecurity of the IPython server configuration so long as you do not store any sensitive data or code in your notebooks.
Open a browser on http://raspberrypi:8888
where raspberrypi is the
hostname of the Pi on which the docker image is running, or on
http://localhost:8888
on the Pi itself.
You should see a screen like this:
aaand you're away to the races!
I'll blog more info about this shortly, and will commit the image to docker central.
In the terminal session where you ran the container, type Ctr-C twice in quick succession. The container will stop.
- Docker: https://github.com/umiddelb/armhf/wiki/Get-Docker-up-and-running-on-the-RaspberryPi-(ARMv6)-in-four-steps-(Wheezy)
- Base image: from a post by the chaps at resin.io
- Pi tensorflow whl file from Sam Abrahm's Github project
- Notebooks and notebook config from The Tensorflow Docker Build on Github