如何 运行 Coral CPU 上的 tflite 模型

How to run tflite model on Coral CPU

真的可以 运行 Coral CPU 上的 tflite 模型吗?

BasicEngine 的珊瑚文档指出:model must be compiled for the Edge TPU; otherwise, it simply executes on the host CPU. Coral doc

我已经尝试 运行 Keras Mobilenet 转换为 tflite 并故意不为 Edge-tpu 编译但出现以下错误

Traceback (most recent call last):
  File "estimate.py", line 69, in <module>
    main()
  File "estimate.py", line 42, in main
    engine = BasicEngine(args.model)
  File "/usr/lib/python3/dist-packages/edgetpu/swig/edgetpu_cpp_wrapper.py", line 300, in __init__
    this = _edgetpu_cpp_wrapper.new_BasicEngine(*args)
RuntimeError: Error in interpreter initialization.

检查转换后的模型输入和输出是否量化为 UINT8。 否则即使在编译模型后它也会发生。

简单的答案是可以。基本上,任何不受支持的操作 运行 在你的模型中自动 运行s 在 CPU 上。有关说明,请参阅 this image