Mac pb转tflite

格式

usage: toco [-h] --output_file OUTPUT_FILE
            (--graph_def_file GRAPH_DEF_FILE | --saved_model_dir SAVED_MODEL_DIR | --keras_model_file KERAS_MODEL_FILE)
            [--output_format {TFLITE,GRAPHVIZ_DOT}]
            [--inference_type {FLOAT,QUANTIZED_UINT8}]
            [--inference_input_type {FLOAT,QUANTIZED_UINT8}]
            [--input_arrays INPUT_ARRAYS] [--input_shapes INPUT_SHAPES]
            [--output_arrays OUTPUT_ARRAYS]
            [--saved_model_tag_set SAVED_MODEL_TAG_SET]
            [--saved_model_signature_key SAVED_MODEL_SIGNATURE_KEY]
            [--std_dev_values STD_DEV_VALUES] [--mean_values MEAN_VALUES]
            [--default_ranges_min DEFAULT_RANGES_MIN]
            [--default_ranges_max DEFAULT_RANGES_MAX]
            [--post_training_quantize] [--drop_control_dependency]
            [--reorder_across_fake_quant]
            [--change_concat_input_ranges {TRUE,FALSE}] [--allow_custom_ops]
            [--target_ops TARGET_OPS] [--dump_graphviz_dir DUMP_GRAPHVIZ_DIR]
            [--dump_graphviz_video]

示例

toco \
--graph_def_file=/Users/ll/Desktop/voc_gesture/export/tflite_graph.pb \
--output_file=/Users/ll/Desktop/voc_gesture/convert/gesture_model.tflite \
--output_format=TFLITE  \
--inference_type=FLOAT \
--input_shapes=1,300,300,3 \
--input_format=TENSORFLOW_GRAPHDEF  \
--input_arrays=normalized_input_image_tensor \
--output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \
--mean_values=128 \
--std_dev_values=128 \
--default_ranges_min=0 \
--default_ranges_max=6 \
--allow_custom_ops
toco \
--graph_def_file=/Users/ll/Desktop/voc_gesture/export/tflite_graph.pb \
--output_file=/Users/ll/Desktop/voc_gesture/convert/gesture_model.tflite \
--output_format=TFLITE  \
--inference_type=FLOAT \
--input_shapes=1,300,300,3 \
--input_format=TENSORFLOW_GRAPHDEF  \
--input_arrays=normalized_input_image_tensor \
--output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \
--mean_values=128 \
--std_dev_values=128 \
--allow_custom_ops

你可能感兴趣的:(Mac pb转tflite)