モバイル、Iot機器向け機械学習ソフトのTensorFlow Liteをraspberry pi で動かしてみる。
TensorFlow Liteとサンプルをインストールする。
TensorFlow Liteのインストール
以下のサイトに書かれてある通り、
https://www.tensorflow.org/lite/guide/python?hl=ja
以下のコマンドを打ちます。
$python3 -m pip install tflite-runtime
サンプルのインストールと実行
下記のサンプルサイト
https://www.tensorflow.org/lite/examples?hl=ja
の画像分類
https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/raspberry_pi
をインストールします。このページに書かれたある通り、以下のコマンドを打ちます。
$git clone https://github.com/tensorflow/examples --depth 1
$cd examples/lite/examples/image_classification/raspberry_pi
$sh setup.sh
早速実行してみる。以下のコマンドを実行
$python3 classify.py
以下のエラーが発生。
ImportError: libcblas.so.3: cannot open shared object file: No such file or directory
以下を実行
$sudo apt-get install libatlas-base-dev
再度以下を実行。動きました。
$python3 classify.py

