TensorFlow 1.9 Officially Supports the Raspberry Pi

TensorFlow
Aug 2, 2018 · 2 min read

By Pete Warden, Software Engineer

Image for post
CC Photo by osde8info

When TensorFlow was first launched in 2015, we wanted it to be an “open source machine learning framework for everyone”. To do that, we need to run on as many of the platforms that people are using as possible. We’ve long supported Linux, MacOS, Windows, iOS, and Android, but despite the heroic efforts of many contributors, running TensorFlow on a Raspberry Pi has involved a lot of work. Thanks to a collaboration with the Raspberry Pi Foundation, we’re now happy to say that the latest 1.9 release of TensorFlow can be installed from pre-built binaries using Python’s pip package system! If you’re running Raspbian 9 (stretch), you can install it by running these two commands from a terminal:

sudo apt install libatlas-base-devpip3 install tensorflow

You can then run python3 in a terminal, and use TensorFlow just as you would on any other platform. Here’s a simple hello world example:

# Pythonimport tensorflow as tftf.enable_eager_execution()hello = tf.constant(‘Hello, TensorFlow!’)print(hello)

If the system outputs the following, then you are ready to begin writing TensorFlow programs:

Hello, TensorFlow!

There are more details on installing and troubleshooting TensorFlow on the Raspberry Pi on the TensorFlow website.

We’re excited about this because the Raspberry Pi is used by many innovative developers, and is also widely used in education to introduce people to programming, so making TensorFlow easier to install will help open up machine learning to new audiences. We’ve already seen platforms like DonkeyCar use TensorFlow and the Raspberry Pi to create self-driving toy cars, and we can’t wait to discover what new projects will be built now that we’ve reduced the difficulty.

Eben Upton, founder of the Raspberry Pi project, says, “It is vital that a modern computing education covers both fundamentals and forward-looking topics. With this in mind, we’re very excited to be working with Google to bring TensorFlow machine learning to the Raspberry Pi platform. We’re looking forward to seeing what fun applications kids (of all ages) create with it,” and we agree!

We’re hoping to see a lot more educational material and tutorials emerge that will help more and more people explore the possibilities of machine learning on such a cost-effective and flexible device.

TensorFlow

TensorFlow is an end-to-end open source platform for…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store