Tiny Tensor Brings Machine Deep Learning to Micros

We’ve talked about TensorFlow before — Google’s deep learning library. Crunching all that data is the province of big computers, not embedded systems, right? Not so fast. [Neil-Tan] and others have been working on uTensor, an implementation that runs on boards that support Mbed-OS 5.6 or higher.

Mbed of course is the embedded framework for ARM, and uTensor requires at least 256K of RAM on the chip and an SD card less than (that’s right; less than) 32 GB. If your board of choice doesn’t already have an SD card slot, you’ll need to add one.

The project is under heavy development right now. You’ll need to use the command line tools for Mbed and expect to spend a little time fiddling with things. The examples use a Nucleo F767ZI which requires an SD card breakout, but for about $20 it might be worth starting with the same board the developer appears to be using.

Of course, you can install TensorFlow on a Raspberry Pi, too, but that’s not really a proper microcontroller. It is really just a function of what your end goal is. It is easy to imagine a robot using an ARM for everything including high-level tasks like object recognition. That’s assuming it has enough horsepower.

By the way, our pocket-sized signal generator project used a K64F board that has an SD card slot and enough memory. That board might be a good target for uTensor.

24 thoughts on “Tiny Tensor Brings Machine Deep Learning to Micros

  1. if it runs an OS, is it still a proper microcontroller?
    And why are they calling it ‘deep learning’? At least the title pic shows a multi layered neural network to me. Some marketing bods needed a ‘new and improved’ lingo?

      1. Yep. There are lots of companies that run a fork of FreeRTOS behind the scenes. I’ve recently worked with Dialog and SiLabs parts that both ran FreeRTOS variants as a part of their Bluetooth stacks.

    1. There have been attempts to differentiate them on various levels against “applications processors” by using things like what sort of memory management system it had (banked, MPU, MMU), equally how the memory was attached and so how predictable its timings were (in implementations terms, the difference between TCM (tightly-coupled) or having a cache in the way). And there was the old classic one of if it needed external RAM or had its own embedded inside.

      I think they’re still justifying calling the Cortex-M7 a uC because it doesn’t have an MMU (only an MPU which still allows it to run some level of OS – maybe not ‘mainline’ Linux but some of the other RTOS derivatives)

      1. that’s what I call “crossing boundary”, you can add DMA also and not only unaligned read. Mbed as most framework do not map this memory for you (or to another section), you need to specify in your linker file and/or use attribute in your code to use it.
        First 64kB is on separate bus (code bus) where upper 192kB is on system bus so if you are executing from RAM it’s better to put code into first 64kB and data on the other segment.

  2. Presumably the less than 32GB requirement is because they don’t want a SDXC card that is formatted with exFAT. The instructions just tell you to copy the test data file onto the formatted card.

  3. Shame it’s on mbed. I’ve tried working with the mbed platform before, and I saw nothing I liked. The “right” way to use it appears to be through the online IDE, and while it is possible to spin up a local workflow, it’s not a great experience.

    The API rubs me the wrong way, too. It’s structured to look like object-oriented C++, but it’s not built in a way that allows you to write true OO code. It’s syntactic wallpaper.

    The biggest problem with mbed for me, though, is that there doesn’t seem to be any information out there about building mbed into your own project. If you want to put your Arduino project onto a custom PCB, you’ll find extensive guidance and reference designs for both AVR and ARM varieties. Burn the bootloader and you’re golden. But mbed seems to want to keep you on their dev boards. When I looked a year ago, I couldn’t find a single project that had integrated mbed software without using mbed hardware, and that’s a worrying state of affairs for a dev board.

    1. Integrating mbed into your own board is quite easy, I’ve done it several times with the LPC1768 and the EFM32GG. The first google hit of “mbed custom pcb” will get you started. I integrate the DAPLink, available on the mbed website, into my design for loading, debugging, and serial-usb with the LPC1768. For the EFM32GG, I use the builtin USB bootloader to load code compiled from the mbed website. Their website isn’t as organized as it could be but all the info you need should be there.

    2. I’ve had success creating project skeletons in the mbed online IDE, then exporting the source to build on my local gcc cross-toolchain.

      Haven’t tried this with anything other than mbed dev boards, though.

  4. Ooo, will have to bookmark this for a future project as I see the Nucleo F746 I’ve had sitting in my desk drawer has 320kB and supports Mbed OS 5.6.
    Just need to a) find a project and b) get a better understanding of what tensor flow is.
    Nothing much then :-/

  5. Wondering when the monthly tensorflow would start.

    Serious note I am seriously interested in unsupervised learning but too many other projects and honey do list. Anyone suggest any good preferably digital sources for research and learning? Really do not want an API walk through but more theory and functionality related information. Yes I know how to search but would like the community to give me suggestions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s