LoginSignup
0

More than 5 years have passed since last update.

raspberry pi 1でtensorflow lite

Last updated at Posted at 2018-12-11

概要

raspberry pi 1でtensorflow liteやってみた。
raspberry pi 1 model bに、インストールしてみた。

環境

Raspberry pi 1 model b(element14)
sd-card 8GB
raspbian 2016-11-25 jessie with pixel

インストール

git cloneして、armv6lでビルドした。

確認

binに、benchmark_modelとminimalができた。
libに、libtensorflow-lite.aができた。

./minimal xor_model.tflite

=== Pre-invoke Interpreter State ===
Interpreter has 13 tensors and 4 nodes
Inputs: 8
Outputs: 1

Tensor   0 activation/Tanh      kTfLiteFloat32  kTfLiteArenaRw         32 bytes ( 0.0 MB)  1 8
Tensor   1 activation_1/Sigmoid kTfLiteFloat32  kTfLiteArenaRw          4 bytes ( 0.0 MB)  1 1
Tensor   2 dense/BiasAdd        kTfLiteFloat32  kTfLiteArenaRw         32 bytes ( 0.0 MB)  1 8
Tensor   3 dense/MatMul_bias    kTfLiteFloat32   kTfLiteMmapRo         32 bytes ( 0.0 MB)  8
Tensor   4 dense/kernel/transpose kTfLiteFloat32   kTfLiteMmapRo         64 bytes ( 0.0 MB)  8 2
Tensor   5 dense_1/BiasAdd      kTfLiteFloat32  kTfLiteArenaRw          4 bytes ( 0.0 MB)  1 1
Tensor   6 dense_1/MatMul_bias  kTfLiteFloat32   kTfLiteMmapRo          4 bytes ( 0.0 MB)  1
Tensor   7 dense_1/kernel/transpose kTfLiteFloat32   kTfLiteMmapRo         32 bytes ( 0.0 MB)  1 8
Tensor   8 dense_input          kTfLiteFloat32  kTfLiteArenaRw          8 bytes ( 0.0 MB)  1 2
Tensor   9 (null)               kTfLiteNoType  kTfLiteMemNone          0 bytes ( 0.0 MB)  (null)
Tensor  10 (null)               kTfLiteNoType  kTfLiteMemNone          0 bytes ( 0.0 MB)  (null)
Tensor  11 (null)               kTfLiteNoType  kTfLiteMemNone          0 bytes ( 0.0 MB)  (null)
Tensor  12 (null)               kTfLiteNoType  kTfLiteMemNone          0 bytes ( 0.0 MB)  (null)

Node   0 Operator Builtin Code   9
  Inputs: 8 4 3
  Outputs: 2
Node   1 Operator Builtin Code  28
  Inputs: 2
  Outputs: 0
Node   2 Operator Builtin Code   9
  Inputs: 0 7 6
  Outputs: 5
Node   3 Operator Builtin Code  14
  Inputs: 5
  Outputs: 1

./benchmark_model --graph=xor_model.tflite

STARTING!
Min num runs: [50]
Min runs duration (seconds): [1]
Inter-run delay (seconds): [-1]
Num threads: [1]
Benchmark name: []
Output prefix: []
Min warmup runs: [1]
Min warmup runs duration (seconds): [0.5]
Graph: [xor_model.tflite]
Input layers: []
Input shapes: []
Use nnapi : [0]
Loaded model xor_model.tflite
resolved reporter
Initialized session in 4.23ms
Running benchmark for at least 1 iterations and at least 0.5 seconds
count=2963 first=385 curr=19 min=18 max=20218 avg=30.4077 std=377

Running benchmark for at least 50 iterations and at least 1 seconds
count=7331 first=43 curr=20 min=17 max=298 avg=22.4294 std=7

Average inference timings in us: Warmup: 30.4077, Init: 4230, no stats: 22.4294

以上。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0