DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Step-By-Step Guide To Setting up and Training GANs for Image Generation
  • Recognizing Music Genres With the Raspberry Pi Pico
  • Norm of a One-Dimensional Tensor in Python Libraries
  • Kafka Event Streaming AI and Automation

Trending

  • Event Driven Architecture (EDA) - Optimizer or Complicator
  • GitHub Copilot's New AI Coding Agent Saves Developers Time – And Requires Their Oversight
  • Scaling Microservices With Docker and Kubernetes on Production
  • Rust, WASM, and Edge: Next-Level Performance
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Using TinkerBoard With TensorFlow and Python

Using TinkerBoard With TensorFlow and Python

In this post, we use ASUS' new embedded platform for Deep Learning and IoT with TensorFlow and Python on this RPI form factor device.

By 
Tim Spann user avatar
Tim Spann
DZone Core CORE ·
May. 24, 17 · Review
Likes (4)
Comment
Save
Tweet
Share
15.5K Views

Join the DZone community and get the full member experience.

Join For Free

I have had an ASUS TinkerBoard for a few months now, so it is time to review and spread the 411 on setting it up and using it for IoT Deep Learning workflows.

Image title

Image title

It is easy to install Python and all the libraries required for IoT and some deep learning. I found most instructions worked for Raspberry Pi on this device. It has more RAM, which helps on some of these activities.

I downloaded and burned, with Etcher, a MicroSD image of TinkerOS_Debian V1.8 (beta version). It's a Debian variant close enough to Raspian for most IoT developers and users to be comfortable. An Android OS is now available for download as well, and that may be worth trying. I wonder if Google will add this device to the AndroidThings supported devices. Perhaps. 

One quirk, make sure you remember this: TinkerOS' default username is “linaro”, and the password is “linaro”.

System and Python Setup

sudo apt-get update
sudo apt-get install cmake gcc g++  libxml2 libxml2-* leveldb*
sudo apt-get install python-dev python3-dev
sudo apt-get install python-setuptools
sudo apt-get install python3-setuptools
pip install twython
pip install numpy
pip install wheel
pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
sudo pip install -U nltk
python
import nltk
nltk.download()
quit()
pip install -U spacy
python -m spacy.en.download all
sudo python -m textblob.download_corpora

# TensorFlow
get https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.0.1/tensorflow-1.0.1-cp27-none-linux_armv7l.whl
sudo pip install tensorflow-1.0.1-cp27-none-linux_armv7l.whl

# For Python 3.4
wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.0.1/tensorflow-1.0.1-cp34-cp34m-linux_armv7l.whl
sudo pip3 install tensorflow-1.0.1-cp34-cp34m-linux_armv7l.whl

# For Python 2.7
sudo pip uninstall mock
sudo pip install mock

# For Python 3.4
sudo pip3 uninstall mock
sudo pip3 install mock
sudo apt-get install git
git clone https://github.com/tensorflow/tensorflow.git

# PAHO for MQTT
pip install paho-mqtt 

# Flask for Web Apps
pip install flask


Python 2.7 and 3.4 both work fine on this device. I was also able to install the major NLP libraries, including SpaCy and NLTK.  TensorFlow was installed using the Raspberry Pi build and ran without incident. I believe it's a bit faster than the RPI version. I will have to run some tests on that.

Run the Regular TensorFlow Inception V3 Demo

python -W ignore /tensorflow/models/tutorials/image/imagenet/classify_image.py --image_file /opt/demo/tensorflow/TimSpann.jpg 


I hacked that version to add code to send the results to MQTT, so I could process with most IoT hubs and Apache NiFi with ease. JSON is a very simple format to work with.

# .... imports
import paho.mqtt.client as paho
import os
import json

# .... later in the code

    top_k = predictions.argsort()[-FLAGS.num_top_predictions:][::-1]
    for node_id in top_k:
      human_string = node_lookup.id_to_string(node_id)
      score = predictions[node_id]
      print('==> %s (score = %.5f)' % (human_string, score))
      row = [ { 'human_string,': str(human_string),  'score,': str(score)} ]
      json_string = json.dumps(row)
      client = paho.Client()
      client.connect("192.168.1.151", 1883, 60)
      client.publish("tinker1", payload=json_string, qos=0, retain=True)


So now we have yet another platform that can be used for IoT and basic Deep Learning and NLP — all enabled by a small, fast Linux device that runs Python.

Enjoy your SBC! I am hoping that they add hats, a hard drive, and some other ASUS accessories.   Making your own mini Debian laptop would be cool.

The next device I am looking at is NVIDIA's powerful GPU SBCs.  There are a couple of options, from 192 GPU cores up to 256 with smoking high-end specs.

Downloads

  • ASUS SBC Download

  • TinkerBoard FAQ

  • Scripts

Python (language) TensorFlow raspberry pi

Opinions expressed by DZone contributors are their own.

Related

  • Step-By-Step Guide To Setting up and Training GANs for Image Generation
  • Recognizing Music Genres With the Raspberry Pi Pico
  • Norm of a One-Dimensional Tensor in Python Libraries
  • Kafka Event Streaming AI and Automation

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!