【问题标题】:Tensorflow Lite: Check Failed when converting with TocoTensorflow Lite:使用 Toco 转换时检查失败
【发布时间】:2019-03-06 15:40:02
【问题描述】:

我正在尝试使用 toco 中的以下命令将我的冻结推理模型转换为 .tflite。

toco\
--graph_def_file=frozen_inference_graph.pb \
--input_format=TENSORFLOW_GRAPHDEF \
--output_format=TFLITE \
--output_file=/leaves.tflite \
--inference_type=FLOAT \
--input_type=FLOAT \
--input_arrays=ImageTensor \
--output_arrays=SemanticPredictions \
--input_shapes=1,513,513,3 \

但我遇到了一个错误

RuntimeError: TOCO failed see console for info.
b'2019-03-06 15:28:46.912978: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: ResizeNearestNeighbor
2019-03-06 15:28:46.956622: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 1790 operators, 2758 arrays (0 quantized)
2019-03-06 15:28:47.000274: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] After Removing unused ops pass 1: 1780 operators, 2739 arrays (0 quantized)
2019-03-06 15:28:47.059984: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 1780 operators, 2739 arrays (0 quantized)
2019-03-06 15:28:47.261502: F tensorflow/contrib/lite/toco/graph_transformations/propagate_fixed_sizes.cc:624] Check failed: input_shape.dims().size() == op->size.size() (4 vs. 3)\nAborted (core dumped)\n'
None

据我了解,“(4 对 3)”中的 4 指的是我的 input_shapes 1,513,513,3 的 4 个维度。但是四处搜索似乎没有人遇到同样的错误,所以我不确定是什么导致了这个问题。

是否有人能够找出问题并提供解决方案?谢谢。

【问题讨论】:

    标签: tensorflow tensorflow-lite


    【解决方案1】:

    "toco" 有点过时了。你可以试试https://www.tensorflow.org/lite/convert/cmdline_examples中详述的“tflite_convert”吗?

    【讨论】:

    • 如果 tflite_convert 不适合您,请在 TensorFlow GitHub 页面上提交 issue。包括重现问题的所有步骤,包括模型文件或重现错误的最小模型。
    猜你喜欢
    • 1970-01-01
    • 2018-09-07
    • 1970-01-01
    • 2020-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-13
    相关资源
    最近更新 更多