【问题标题】:How to convert TFLite model to quantized TFLite model?如何将 TFLite 模型转换为量化的 TFLite 模型?
【发布时间】:2020-10-15 13:08:50
【问题描述】:

我有一个 tflite 文件,我想量化它。

如何将 TFLite 模型转换为量化的 TFLite 模型?

【问题讨论】:

    标签: tensorflow model converters quantization


    【解决方案1】:

    根据您使用的是 keras 还是 tfhub,您可以简单地执行以下操作 [这是假设 TF 模型不支持量化]:

    converter = tf.lite.TFLiteConverter.from_keras_model(non_qat_model)
    converter.optimizations = [tf.lite.Optimize.DEFAULT]
    quantized_tflite_model = converter.convert()
    

    您可以进一步参考此处的链接: https://www.tensorflow.org/lite/performance/post_training_quantization

    【讨论】:

    • 输入是保存的模型,而不是 tflite 模型
    猜你喜欢
    • 1970-01-01
    • 2019-05-06
    • 2021-01-24
    • 2021-09-27
    • 1970-01-01
    • 1970-01-01
    • 2021-02-13
    • 2020-10-10
    • 1970-01-01
    相关资源
    最近更新 更多