2
votes

I am looking to compress/optimise my tensorflow NN model following tensorflow-lite's post training quantization guild, I am using Tensorflow 1.13.1 (NON GPU)

However, when I use the convert function I've met with a lot of error messages:

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)

Having Googled/SO around it seems this is because not all tensorflow operaions are supported by tf-lite. My model has customised operations such as attention, biLSTM etc.

How do I know which NN architectures are supported? For the errors I received, how do I know where is the source of the problem? e.g.

Unsupported data type in placeholder op: 20

what is this 20 refers to?

1

1 Answers

0
votes

The source of the problem is in ConvertDataType() function here.

The unsupported datatype 20 is

38: DT_RESOURCE = 20;