Share
Embed
EdgeTPUを使ってみよう
clouddev-code
September 26, 2023
Transcript
23 slides
-
AGENDA 2 1 2 3 4 Edge Computing て。 Edge
Computingとは EdgeTPUて?Network Edgeとかいろいろある が。 EdgeTPU 手軽なところでRaspberry PiでEdgeTPUが使え ます Raspberry Piで試そう まとめ -
About Us My work • cloud DevOps architecture construction. Interesting
• BigQuery and google Dataflow. • Data Loss Prevention • Cloud Endpoints 3 s.hiruta @web_se URL:https://www.totalsolution.biz Soushi Hiruta +αの連携機能。 -
Cloud Data Loss Prevention 4 Cloud Functions Name BigQuery Cloud
Pub/Sub gcloud pubsub topic publish -message ‘test 2 is [email protected]’ -
Edge Computingとは 7 1 2 AWS Lambda/Edge、Cloudflare Workers Network Edge
Edge TPU、Inflerence edge、AWS IoT Greengrass IoT Edge -
IoT Edge 8 1 2 IoT edge CPUは低スペック。e,x, Raspberry Pi、Arduino
Microcontrollers use for less power than CPUs RAMもPC、サーバほど積まれていない。 Only tens of kiobytes of RAM 2 ネットワークに接続されていないケースがある No Cloud Connections -
TPU 10 1 2 機械学習に特化したGoogleの自社開発プロセッサ。三世代目が、Gogle IO 2018で発表。最新はTPU2.0の8倍の性能をも つとのこと。 TPU IoT
Deviceに特化したTensorFlowを用いた機械学習を効率良く行うカスタム ASC Edge TPU -
USB Acceleratorsのお話 11 1 2 USB 3.0に対応していると、よりパフォーマンスが出る。 USB3.0 Type-C socket
Debian 系に対応 Debian 6.0 or higher, or any derivative thereof ( such as Ubuntu 10.0+) 2 設定次第でパフォーマンスがあげることができる。ただし、熱をもつとも記載あり default or maximum clock frequency https://www.youtube.com/watch?v=CukaWaWbBHY&t=849s Raspberry Pi USB2.0なので、ここがボトルネックになるか と。 DetectWithImage 0.28248214599989296 sec ※mobilenet_ssd_v2_coco_quant_postpr ocess_edgetpu.tfliteモデル ClassifyWithImage 1.3688266489998568 sec ※inception_v4_299_quant_edgetpu.tflit eモデル -
OpenCV構築 15 Raspbian 9.4 ( Stretch / Debian 9.0) 4.14.79-v7+
https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html • Raspbian公式サイトで公開されているものなら、ビル ドは問題なく可 • ビルドに時間がかかる。ネットの情報によりと、途中 でビルドが止まる場合あり -
Modelの作成 16 (Retrain an image classification model on-device) python3 demo/classification_transfer_learning.py
\ --extractor ${DEMO_DIR}/mobilenet_v1_1.0_224_quant_embedding_extractor_edgetpu.tflite \ --data ${DEMO_DIR}/flower_photos \ --output ${DEMO_DIR}/flower_model.tflite \ --test_ratio 0.95 データセットの中でどのくらいの画像を test datasetとして使うか割合を指定 embedding extractor (this is a version of the CNN network without the final fully-connected layer that's pretrained on ImageNet) https://coral.withgoogle.com/tutorials/edgetpu-retrain-classification-ondevice/ -
イメージの分類 18 Getting Started : https://coral.withgoogle.com/tutorials/accelerator/ python3 demo/classify_image.py \ --model
test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \ --label test_data/inat_bird_labels.txt \ --image test_data/parrot.jpg -
Reference 22 http://storage.googleapis.com/cloud-iot-edge-pretrained-models/edgetpu_api_reference.zip https://coral.withgoogle.com/tutorials/accelerator/ https://coral.withgoogle.com/tutorials/accelerator-datasheet/ https://qiita.com/hidakanoko/items/3f2f6ae9b5af2b06eec6 Edge TPU API reference
(ZIP) OpenCVのビルドは下記が参考になります。 EdgeTPU USB Accelertor