在 Tensorflow 2.X 中测量 TFLite 模型的触发器

Dav*_*ord 5 python machine-learning keras tensorflow tensorflow2.0

我正在尝试测量 TF2 中 TFLite 模型的 FLOPS。我知道 Tensorflow 1.x 有 tf.profiler,它对于测量失败非常有用。它似乎与 tf.keras 配合得不好。

有人可以描述一下如何测量 TF2 中 TFLite 模型的 FLOP 吗?我似乎无法在网上找到答案。非常感谢大家抽出宝贵的时间。

编辑:下面评论的链接对 tflite 没有帮助。

小智 3

我遇到了同样的问题,写了一个简单的python包来粗略计算FLOPS。

https://github.com/lisosia/tflite-flops

仅考虑 Conv 和 DepthwiseConv 层,但这对于我的用例来说已经足够了。