我正在尝试将在Cityscapes数据集上训练的DeepLab从此处转换为TFLite。通过在Netron中查看冻结图,输入和输出张量均为uint8类型。我能够使用为TFLite GPU委托提供的默认DeepLab模型,该模型具有float32输入和输出张量。我不认为应该对模型进行量化,因此在尝试以下代码时,如果没有注释行,则会出现此错误:
F tensorflow/lite/toco/tooling_util.cc:2241] Check failed: array.data_type == array.final_data_type Array "ImageTensor" has mis-matching actual and final data types (data_type=uint8, final_data_type=float).
此后,我发现我应该尝试对模型进行量化。我插入注释行以使用uint8而不是float32,但出现此错误,这似乎是不受支持的操作。
F ./tensorflow/lite/toco/toco_tooling.h:38] Check failed: s.ok() Unimplemented: this graph contains anoperator of type Cast for which the quantized form is not yet implemented. Sorry, and patches welcome (that's a relatively fun patch to write, mostly providing the actual quantized arithmetic code for this op).
使用量化脚本是否正确?提供的现成的TFLite DeepLab模型使用float32。谢谢!