- https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_mobile_tensorflowlite.md
- export CONFIG_FILE=PATH_TO_BE_CONFIGURED/pipeline.configexport CHECKPOINT_PATH=PATH_TO_BE_CONFIGURED/model.ckptexport OUTPUT_DIR=/tmp/tflite
- object_detection/export_tflite_ssd_graph.py \
- --pipeline_config_path=$CONFIG_FILE \
- --trained_checkpoint_prefix=$CHECKPOINT_PATH \
- --output_directory=$OUTPUT_DIR \
- --add_postprocessing_op=true
- bazel run --config=opt tensorflow/lite/toco:toco -- \
- --input_file=$OUTPUT_DIR/tflite_graph.pb \
- --output_file=$OUTPUT_DIR/detect.tflite \
- --input_shapes=1,300,300,3 \
- --input_arrays=normalized_input_image_tensor \
- --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \
- --inference_type=QUANTIZED_UINT8 \
- --mean_values=128 \
- --std_values=128 \
- --change_concat_input_ranges=false \
- --allow_custom_ops
- bazel run --config=opt tensorflow/lite/toco:toco -- \
- --input_file=$OUTPUT_DIR/tflite_graph.pb \
- --output_file=$OUTPUT_DIR/detect.tflite \
- --input_shapes=1,300,300,3 \
- --input_arrays=normalized_input_image_tensor \
- --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \
- --inference_type=FLOAT \
- --allow_custom_ops
- cp /tmp/tflite/detect.tflite \
- //tensorflow/lite/examples/android/app/src/main/assets
版权声明:本文为CSDN博主「九是否非随机的称呼」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/m0_50617544/article/details/120639106
暂无评论