1

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

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

这将在调用时导致错误:

interpreter->AllocateTensors()

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

有什么建议么?

我问的另一个问题: 使用 tensorflow 更改 mobilenet_ssd 的输入图像大小

4

1 回答 1

1

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

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

于 2018-06-08T22:20:35.453 回答