python - interpreter.get_input_details() 中的 'quantization' 是什么意思?

标签 python tensorflow tensorflow-lite quantization

使用 tflite 并获取解释器的属性,例如:

print(interpreter.get_input_details())

[{'name': 'input_1_1', 'index': 47, 'shape': array([  1, 128, 128,   3], dtype=int32), 'dtype': <class 'numpy.uint8'>, 'quantization': (0.003921568859368563, 0)}]

'quantization': (0.003921568859368563, 0) 是什么意思?

最佳答案

表示量化参数值:输入张量的scale和zero_point。

这是使用公式将量化的 uint8 数字 q 转换为 float f 所必需的:

f = (q - zero_point) * scale

关于python - interpreter.get_input_details() 中的 'quantization' 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54830126/

相关文章:

python - 可视化 TFLite 图并获取特定节点的中间值?

c++ - esp32_cam读取并处理镜像

python - 如何重新启动 Python 脚本?

tensorflow - 损失函数设计为假阳性和假阴性结合不同的权重

python - tensorflow 中 RNN 的编码器解码器模型

python - 形状为 T1 = N*D、T2 = M*D 的两个 tensorflow 张量; M < N。T1 在 T2 中有行。查找 T1 张量中 T2 中每一行的行索引

tensorflow - TensorFlow lite 可以使用自定义 CPU 构建吗?

python - 如何将数据框中的每个单词组成一个句子,并在句号或问号之后生成下一个句子?

python - Django 和 Gunicorn 中的错误记录

python - 生成每个数字 0..k 的随机矩阵