通过冻图生成tflite文件:
tensorflow-master$> bazel build tensorflow/contrib/lite/toco:toco
tensorflow-master$> bazel-bin/tensorflow/contrib/lite/toco/toco \
--input_file=/home/tclxa/TCL/tmp/frozen_model.pb \
--input_format=TENSORFLOW_GRAPHDEF \
--output_format=TFLITE \
--output_file=/home/tclxa/TCL/tmp/mobilenet_quant_v1_224.tflite \
--inference_type=FLOAT \
--input_type=FLOAT \
--input_arrays=input \
--output_arrays=MobilenetV1/Predictions/Reshape_1 \
--input_shapes=1,224,224,3
–output_file、–inference_type、–input_type、–input_arrays、–output_arrays、–input_shapes需要根据自己模型说明作相应的修改
通过ckpt和结构pb生成冻图:.ckpt和结构.pb文件
tensorflow-master$> bazel build tensorflow/python/tools:freeze_graph
tensorflow-master$> bazel-bin/tensorflow/python/tools/freeze_graph \
--input_graph=/home/tclxa/TCL/tmp/mobilenet_v1_224.pb \
--input