Skip to content

liuqun/rpi-docker-tensorflow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpi-docker-tensorflow

Update:

Docker now officially support ARM architecture and this build uses the new Docker package for the Pi.

I tested the build using the latest version of raspbian/jessie-lite and a 16 Gb SD card on a Raspberry Pi model 3B.

Earlier attempts using an 8Gb card failed with disk full.

The build creates 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, the Docker team, 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.

The script builds a container based on Sam Abraham's initial release of TensorFlow 0.10 for the Raspberry Pi.

Build instructions

  1. Install Docker on your 64-bit x86 cross-build host.
    • curl -sSL get.docker.com | sh
    • sudo usermod -aG docker pi
    • log out, then log back in again for the change to take effect
    • sudo systemctl start docker
  2. Run qemu multiarch support service.
    • docker run --rm --privileged multiarch/qemu-user-static:register
  3. Clone this repository into a directory of your choice
    • git clone https://github.com/liuqun/rpi-docker-tensorflow.git
    • cd rpi-docker-tensorflow
    • git checkout crossbuild
  4. Build the image
    • cd build-tensor-pi
    • docker build -t='yourName/rpi-docker-tensorflow' .

Running the image

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.

Connecting to the 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.

Stopping the image

In the terminal session where you ran the container, type Ctr-C twice in quick succession. The container will stop.

Sources

  1. Docker: http://blog.alexellis.io/getting-started-with-docker-on-raspberry-pi/
  2. Base image: from a post by the chaps at resin.io
  3. Pi tensorflow whl file from Sam Abrahm's Github project
  4. Notebooks and notebook config from The Tensorflow Docker Build on Github

About

Docker container for the Raspberry Pi containing Tensorflow and Jupyter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 82.8%
  • Jupyter Notebook 17.1%
  • Other 0.1%