Skip to Content
タイニーエムエル
book

タイニーエムエル

by Pete Warden, Daniel Situnayake
March 2025
Intermediate to advanced
504 pages
7h 53m
Japanese
O'Reilly Media, Inc.
Content preview from タイニーエムエル

付録A. ArduinoライブラリZipの使用と生成

Arduino IDEでは、ソースファイルを特定の方法でパッケージ化する必要がある。TensorFlow Lite for Microcontrollers Makefileは、この方法を知っており、すべてのソースを含む.zipファイルを生成して、Arduino IDEにライブラリとしてインポートすることができる。これで、アプリケーションをビルドしてデプロイすることができる。

このファイルの生成方法は、このセクションの後半で説明する。しかし、最も簡単な方法は、TensorFlowチームによって毎晩生成されるビルド済みの.zipファイルを使用することだ。

そのファイルをダウンロードしたら、インポートする必要がある。Arduino IDEのSketchメニューで、図A-1に示すように、Include Library→Add .ZIPライブラリを選択する。

Screenshot of the Add .ZIP Library menu option
図A-1. .ZIPライブラリを追加... "メニューオプション

表示されたファイルブラウザで.zipファイルを探し、Chooseをクリックしてインポートする。

例えば、TensorFlowのGitリポジトリにあるコードに変更を加え、Arduino環境でテストしたい場合などだ。

自分でファイルを生成する必要がある場合は、ターミナル・ウィンドウを開き、TensorFlowリポジトリをクローンして、そのディレクトリに移動する:

git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow

次のスクリプトを実行して、.zipファイルを生成する:

tensorflow/lite/micro/tools/ci_build/test_arduino.sh

ファイルは以下の場所に作成される:

tensorflow/lite/micro/tools/make/gen/arduino_x86_64/ \
  prj/micro_speech/tensorflow_lite.zip

この.zipファイルをArduino IDEにインポートするには、先に説明した手順を使う。もし以前にこのライブラリをインストールしたことがあるなら、まず元のバージョンを削除する必要がある。Arduino IDEのLibrariesディレクトリからtensorflow_liteディレクトリを削除する。Arduino IDEのPreferencesウィンドウの "Sketchbook location "で発見できる。

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

認定倫理的ハッカー(CEH)勉強ガイド

認定倫理的ハッカー(CEH)勉強ガイド

Matt Walker
実践者向けの説明可能なAI

実践者向けの説明可能なAI

Michael Munn, David Pitman
ソフトウェア工学の基礎

ソフトウェア工学の基礎

Nathaniel Schutta, Dan Vega
エッジのAI

エッジのAI

Daniel Situnayake, Jenny Plunkett

Publisher Resources

ISBN: 9798341627000