张量流训练后量化支持的操作列表

时间:2019-05-03 11:39:00

标签: tensorflow tensorflow-lite

我正在按照tensorflow-lite的post training quantization行会来压缩/优化我的tensorflow NN模型,我正在使用Tensorflow 1.13.1(NON GPU)

但是,当我使用convert函数时,遇到了很多错误消息:

ConverterError: TOCO failed. See console for info.
2019-05-02 11:31:10.209374: I tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: TensorArrayV3
2019-05-02 11:31:10.217858: I  tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2019-05-02 11:31:10.217893: I  tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: TensorArrayV3
2019-05-02 11:31:10.217905: I  tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2019-05-02 11:31:10.217939: I  tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: TensorArrayScatterV3
2019-05-02 11:31:10.217961: I  tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: Enter
2019-05-02 11:31:10.217971: I  tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: Enter
2019-05-02 11:31:10.217979: I  tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: Enter
2019-05-02 11:31:10.217988: I  tensorflow/lite/toco/import_tensorflow.cc:1324] Converting unsupported operation: Enter
......
2019-05-02 11:31:10.223877: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 236 operators, 384 arrays (0 quantized)
2019-05-02 11:31:10.226115: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] After Removing unused ops pass 1: 226 operators, 368 arrays (0 quantized)
2019-05-02 11:31:10.229770: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 226 operators, 368 arrays (0 quantized)
2019-05-02 11:31:10.232686: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] After general graph transformations pass 1: 177 operators, 280 arrays (0 quantized)
2019-05-02 11:31:10.235370: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before dequantization graph transformations: 177 operators, 280 arrays (0 quantized)
2019-05-02 11:31:10.237009: F tensorflow/lite/toco/tooling_util.cc:627] Check failed: dim >= 1 (0 vs. 1)
Aborted (core dumped)

使用Googled / SO似乎是因为tf-lite不支持所有的tensorflow操作。我的模型具有自定义操作,例如注意力,biLSTM等。

我如何知道支持哪些NN体系结构?对于收到的错误,我怎么知道问题的根源在哪里?例如

Unsupported data type in placeholder op: 20

这20代表什么?

1 个答案:

答案 0 :(得分:0)

问题的根源在 ConvertDataType()函数here中。

不受支持的数据类型 20

38DT_RESOURCE = 20;