小编JiP*_*JiP的帖子

LSTM模型的tensorflow lite转换

我正在尝试使用tensorflow TOCO和tf_convert工具将基于tensorflow(LSTM)的模型转换为tensorflow lite ,但是转换后的tensorflow lite模型约为245MB,其中原始tensorflow mobile约为1MB。

以下是我使用的命令

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
Run Code Online (Sandbox Code Playgroud)

我尝试使用,--allow_custom_ops并且转换模型的大小与是否使用TOCO工具中的自定义操作相同。

2018-08-27 18:09:18.538279:我tensorflow / contrib / lite / toco / graph_transformations / graph_transformations.cc:39]删除未使用的操作之前:4210个运算符,6021个数组(0量化)2018-08-27 18:09 :19.255416:I tensorflow / contrib / lite / toco / graph_transformations / graph_transformations.cc:39]在通用图变换之前:4210个运算符,6021个数组(0量化)2018-08-27 18:09:20.504422:I tensorflow / contrib / lite / toco / graph_transformations / graph_transformations.cc:39]在通用图形转换通过1:3604运算符之后,6008个数组(0量化)2018-08-27 18:09:21.335526:I tensorflow / contrib / …

tensorflow tensorflow-lite toco

5
推荐指数
0
解决办法
850
查看次数

标签 统计

tensorflow ×1

tensorflow-lite ×1

toco ×1