【发布时间】:2021-04-18 22:46:39
【问题描述】:
我有一个自定义 tensorflow 模型,我使用 here 中提到的 Float16 量化将其转换为 tflite。
但是使用 tflite 解释器的 tflite 模型的输入细节是
[{'name': 'input_1',
'index': 0,
'shape': array([ 1, 256, 256, 3], dtype=int32),
'shape_signature': array([ -1, 256, 256, 3], dtype=int32),
'dtype': numpy.float32,
'quantization': (0.0, 0),
'quantization_parameters': {'scales': array([], dtype=float32),
'zero_points': array([], dtype=int32),
'quantized_dimension': 0},
'sparsity_parameters': {}}]
而输出细节是
[{'name': 'Identity',
'index': 636,
'shape': array([ 7, 1, 256, 256, 1], dtype=int32),
'shape_signature': array([ 7, -1, 256, 256, 1], dtype=int32),
'dtype': numpy.float32,
'quantization': (0.0, 0),
'quantization_parameters': {'scales': array([], dtype=float32),
'zero_points': array([], dtype=int32),
'quantized_dimension': 0},
'sparsity_parameters': {}}]
转换有问题吗?
我在将 tf 模型转换为 tflite 时也收到此警告
WARNING:absl:Found untraced functions such as _defun_call, _defun_call, _defun_call, _defun_call, _defun_call while saving (showing 5 of 63). These functions will not be directly callable after loading.
WARNING:absl:Found untraced functions such as _defun_call, _defun_call, _defun_call, _defun_call, _defun_call while saving (showing 5 of 63). These functions will not be directly callable after loading.
P.S我也尝试过进行this 量化,但收到了与该 tflite 模型相同的输入/输出细节。
【问题讨论】:
标签: python tensorflow tensorflow-lite