JiP*_*JiP 5 tensorflow tensorflow-lite toco
我正在尝试使用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 / lite / toco / graph_transformations / [graph_transformations.cc:39]在解量化图形转换之前:3604个运算符,6008个数组(0量化)2018-08-27 18:09:21.897161:我tensorflow / contrib / lite / toco / allocate_transient_arrays.cc:329]分配的总瞬态数组大小:15616字节,理论最佳值:15616字节。
是否有计划在不久的将来使用tensorflow支持LSTM相关操作?
归档时间: |
|
查看次数: |
850 次 |
最近记录: |