我正在尝试在TensorFlow 2中测量TFLite模型的FLOPS。我知道TensorFlow 1.x有tf.profiler,它非常适合测量FLOPS。但它似乎与tf.keras的兼容性不佳。
请问有人能说明如何在TF2中测量TFLite模型的FLOPS吗?我在网上似乎找不到答案。非常感谢大家的时间。
编辑:下方评论的链接对tflite没有帮助。
回答:
我遇到了相同的问题,并编写了一个简单的Python包来大致计算FLOPS。
https://github.com/lisosia/tflite-flops
只考虑了Conv和DepthwiseConv层,但这对于我的用例已经足够了。