I am trying to covert a tensorflow (LSTM) based model to tensorflow lite using tensorflow TOCO and tf_convert tool, but the tensorflow lite model after conversion is around 245MB where as the original tensorflow mobile is around ~1MB.
Below is the command I have used
bazel run --config=opt //tensorflow/contrib/lite/toco:toco -- \
--input_file= <inputfile> \
--output_file= <outputfile> \
--input_format=TENSORFLOW_GRAPHDEF \
--output_format=TFLITE \
--input_shape=1,1\
--input_array=input\
--output_array=output\
--inference_type=QUANTIZED_UINT8 \
--inference_type=FLOAT \
--input_data_type=FLOAT \
--allow_custom_ops
I have tried with the --allow_custom_ops and the size of the converted model is same with/without the custom operation in TOCO tool.
2018-08-27 18:09:18.538279: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 4210 operators, 6021 arrays (0 quantized) 2018-08-27 18:09:19.255416: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 4210 operators, 6021 arrays (0 quantized) 2018-08-27 18:09:20.504422: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] After general graph transformations pass 1: 3604 operators, 6008 arrays (0 quantized) 2018-08-27 18:09:21.335526: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before dequantization graph transformations: 3604 operators, 6008 arrays (0 quantized) 2018-08-27 18:09:21.897161: I tensorflow/contrib/lite/toco/allocate_transient_arrays.cc:329] Total transient array allocated size: 15616 bytes, theoretical optimal value: 15616 bytes.
Is there any plan for tensorflow to support the LSTM related operations in near future?