TOCO/Tensorflow .pb to .tflite output_arrays不起作用



我对Tensorflow比较陌生,我已经构建了一个自定义训练的图像模型,这是一个重新训练的mobilenetv1模型。我目前有一个 .pb 图和一个标签.txt文件。

我正在尝试使用 TOCO 将我的 .pb 图转换为 .tflite 图,以便我可以将其与 Firebase 一起使用,但在尝试运行 TOCO 时不断收到错误。我在终端中运行的代码是:

./toco 
--input_file=/***/frozen_graph.pb 
--input_format=TENSORFLOW_GRAPHDEF 
--output_format=TFLITE 
--output_file=/***/newGraph.tflite 
--inference_type=FLOAT 
--input_arrays=input 
--input_shapes=1,224,224,3 

我尝试指定--output_arrays标志,但我不知道要为它设置什么。我在终端中遇到的错误是:

F tensorflow/contrib/lite/toco/tooling_util.cc:1480] Check failed: model->flags.output_arrays_size() > 0 (0 vs. 0)This model does not define output arrays, so a --output_arrays flag must be given on the command-line.
Abort trap: 6

我花了很多小时试图弄清楚--output_arrays等于什么,但我被困住了。我运行的是 MacOS 10.13.3。请帮助我谢谢

--output_arrays

是TOCO中的必需标志。大多数MobileNetV1型号都有MobilenetV1/Predictions/Reshape_1的输出数组,但是它可能因型号而异。查看输出数组的最佳方法是使用 TensorBoard 可视化您的图形。

最新更新