TensorFlow 1.9 Officially Supports the Raspberry Pi

TensorFlow
Aug 2, 2018 · 2 min read

By Pete Warden, Software Engineer

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…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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