【发布时间】:2018-05-22 12:04:33
【问题描述】:
我已关注this 链接,并通过微调我的自定义数据集成功地为 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 解释器时出现以下错误。因此,我没有得到任何推论。
Input error: Failed to get input dimensions. 0-th input should have 6021120 bytes, but found 602112 bytes.
【问题讨论】:
-
你能尝试在 Tensorboard 中可视化图表吗?或尝试转换为 pbtxt 文件并确保正确命名输入节点? import tensorflow as tf path_to_pb = '...' output_file = '...' g = tf.GraphDef() with open(path_to_pb, 'r') as f: g.ParseFromString(str(f.read())) with open(output_file, 'w') as f: f.write(str(g))
-
我发现了问题。下面回答。原来你的标志本身有一个错字。在上下文中,请注意上述注释仅用于调试过去。
标签: android tensorflow deep-learning tensorflow-lite