2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Coral Edge TPU、畳込みの演算はすごく速いようなので、比較的重たいモデルで検証する。

Last updated at Posted at 2020-05-07

はじめに

『Edge TPU USB Acceleratorの解析 - Operationとモデル構造』
https://qiita.com/iwatake2222/items/c3a63027d44434633922
の記事で、
Conv層がかなり得意で、Dense層はわりと苦手のような記事があったので、
様子を確認した。

結果

Conv層の速さを活かすために、比較的、重たいモデルで処理速度を確認した。

inception_v3_299_quant_edgetpu.tflite

C:\_work1\_win_corel1\edgetpu_runtime\corel\tflite-master\python\examples\classification>python classify_image.py --model inception_v3_299_quant_edgetpu.tflite --labels imagenet_labels.txt --input images/parrot.jpg
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
85.8ms
44.3ms
43.8ms
44.4ms
56.0ms
45.1ms
44.8ms
43.7ms
45.0ms
44.4ms
44.0ms
43.9ms
44.0ms
43.8ms
43.2ms ★
-------RESULTS--------
89  macaw: 0.99609

C:\_work1\_win_corel1\edgetpu_runtime\corel\tflite-master\python\examples\classification>

inception_v3 の演算量は、
Intelのopenvinoの情報であるが、
https://github.com/opencv/open_model_zoo/blob/master/models/public/index.md
によると、
11.469(GFlops)。TPUの場合は、浮動小数点演算ではないが、そのままGopsと読み替えて、

11.469 * 1000/43.2 → 265 (GOPS)

上記数値は、速いと言えるのではないでしょうか。
(普通のモデルなので、Dense層は当然あるので、それが足を引っ張っている?)

inception_v4_299_quant_edgetpu.tflite

C:\_work1\_win_corel1\edgetpu_runtime\corel\tflite-master\python\examples\classification>python classify_image.py --model inception_v4_299_quant_edgetpu.tflite --labels imagenet_labels.txt --input images/parrot.jpg
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
99.2ms
87.7ms
117.4ms
87.7ms
88.4ms
85.2ms
85.2ms
85.0ms ★
85.1ms
85.2ms
85.2ms
85.1ms
85.3ms
85.1ms
85.7ms
-------RESULTS--------
89  macaw: 0.99609

C:\_work1\_win_corel1\edgetpu_runtime\corel\tflite-master\python\examples\classification>

inception_v4 の演算量は、
Intelのopenvinoの情報であるが、
https://github.com/opencv/open_model_zoo/blob/master/models/public/index.md
によると、
24.584(GFlops)。
TPUの場合は、浮動小数点演算ではないが、上記をそのままGopsと読み替えて、

24.584 * 1000/85.0 → 289 (GOPS)

上記数値は、速いと言えるのではないでしょうか。
(普通のモデルなので、Dense層は当然あるので、それが足を引っ張っている?)

※この結果は、下記のCoralの提示しているbenchの結果と一致している。。。(たまたま?)
https://coral.ai/docs/edgetpu/benchmarks/

coral_bench1.png

まとめ

Coral Edge TPUの演算の速さが、確認できた。289 (GOPS)
コメントなどあれば、お願いします。

2
1
0

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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?