我已经按照这个链接并通过微调我的自定义数据集成功地为 MoiblenetV2_1.4_224 创建了冻结图。然后,我按照tensorflow-for-poets:tflite使用以下命令使用 toco 创建 tflite 图。
IMAGE_SIZE=224
toco \
--input_file=frozen_mobilenet_v2.pb \
--output_file=optimized_graph.lite \
--input_format=TENSORFLOW_GRAPHDEF \
--output_format=TFLITE \
--input_shape=10,${IMAGE_SIZE},${IMAGE_SIZE},3 \
--input_array=input \
--output_array=MobilenetV2/Predictions/Softmax \
--inference_type=FLOAT \
--input_data_type=FLOAT
lite 图已成功创建,但在推理期间,在运行 tflite Interpretor 时出现以下错误。因此,我没有得到任何推论。
Input error: Failed to get input dimensions. 0-th input should have 6021120 bytes, but found 602112 bytes.