Difference between revisions of "R2Inference/Supported backends/Coral from Google"

From RidgeRun Developer Connection
Jump to: navigation, search
(Google Coral)
(No difference)

Revision as of 11:43, 16 February 2021



Previous: Supported_backends/TensorRT Index Next: Supported_backends/ONNXRT




Introduction

The EdgeTPU is an ASIC designed by Google to provide high-performance machine learning applications that are running on embedded devices. The EdgeTPU library extends the TensorFlow Lite framework. For more information about the EdgeTPU hardware go to the Coral Dev Board page.

Installation

R2Inference EdgeTPU backend depends on the C/C++ TensorFlow API and the TensorFlow Lite backend. The installation process consists of downloading the source code, build and install it.

TensorFlow Python API and utilities can be installed with Python PIP. These are not needed by R2Inference, but they are highly recommended if you need to generate models.

Google Coral

You can install the C/C++ Tensorflow API following the next steps:

Build and install Tensorflow Lite

Download Tensorflow source code and checkout the latest release tag (as per now 2.4.1).

git clone https://github.com/tensorflow/tensorflow
git checkout 85c8b2a817f95a3e979ecd1ed95bff1dc1335cff
cd tensorflow/tensorflow/lite/tools/make

Download dependencies

./download_dependencies.sh

Build

  • For x86:
./build_lib.sh

Copy the static library to the libraries path:

sudo cp gen/linux_x86_64/lib/libtensorflow-lite.a /usr/local/lib/
  • For aarch64:
./build_aarch64_lib.sh

Copy the static library to the libraries path:

sudo cp gen/linux_aarch64/lib/libtensorflow-lite.a /usr/local/lib/

Install abseil dependency

cd downloads/absl/
mkdir build && cd build
cmake ..
make && sudo make install

Troubleshooting

With the Tensorflow commit d855adfc5a0195788bf5f92c3c7352e638aa1109, there is a bug with the Makefile that does not include the sparsity source files and can provoke linkage errors. To fix this issue, apply the following patch in your Tensorflow local repo: Fix a build error with Makefile.

API

As the EdgeTPU backend is an extension of the TensorFlow Lite backend, hence, it keeps the same parameter options as presented R2Inference/Supported_backends/TensorFlow-Lite#API section.



Previous: Supported_backends/TensorRT Index Next: Supported_backends/ONNXRT