【问题标题】:tensorflow lite(tflite) invoke error after resize the input dimension调整输入尺寸后,tensorflow lite(tflite)调用错误
【发布时间】:2018-06-07 07:50:27
【问题描述】:

我使用 mobilenet_ssd.tflite 作为官方 tensorflow github 的模式。代码如下:

int input = interpreter->inputs()[0];
interpreter->ResizeInputTensor(input, sizes);

调用时会报错:

interpreter->AllocateTensors()

如果我注释掉解释器->ResizeInputTensor(input, sizes);那么一切都很好。

有什么建议吗?

我问的另一个问题: change the input image size for mobilenet_ssd using tensorflow

【问题讨论】:

    标签: tensorflow tensorflow-lite


    【解决方案1】:

    ResizeInputTensor 受神经网络架构的限制。它失败了,因为 MobileNet 和 MobileNet SSD 只能处理固定大小的输入。

    可能起作用的是改变批量大小。例如,您可以尝试将大小从 (1, 244, 244, 3) 更改为 (4, 244, 244, 3),并在一个 Invoke 调用中对 4 个图像进行推理。

    【讨论】:

    • MobileNet SSD 可以通过桌面 tensorflow 调整大小,我猜有一个算子是 tflite 无法处理的。我想在 tflite 中重新实现该操作。但我不知道哪个操作不支持在 tflite 中调整大小。 tensorflow/contrib/lite/kernels/reshape.cc:68 num_input_elements != num_output_elements (17328 != 4332)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-06
    • 2017-08-30
    • 2018-10-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多