Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 2.36 KB

tflite_and_edge_tpu.md

File metadata and controls

32 lines (24 loc) · 2.36 KB

tflite

tf-lite主要做了什麼事?

edgetpu

  • 開箱文

  • 可以將 tflite 模型compile成edgetpu support的形式,那麼就可以使用edgetpu做推論,需要使用edgetpu compilerposenet中的BasicEngine有python接口

  • can edge TPU run two model at the same time?

    • [Background] yes, but it might be slow, because edgetpu cache the model parameters in edgetpu memory, which enabling fast inference speed. when running a second model if we want, requires swapping the model parameter data in RAM,
    • [Possible solution] co-compiling your models, which allows the Edge TPU to store the parameter data for multuple models in RAM together, which means it typically works well onlu for small models

edge-tpu API flow

  • 若API flow的推論速度或推論精確度不符合預期,那麼就需要考慮自己做model puring,distilling,參考 README中的 Model Compression章節

  • keras / tensorflow (pb file) -> tflite (.tflite) -> edgetpu_compiler (.tflite)

    • example posenet_mobilenet_v1_edgetpu.tflite 1.3M