tensorflow lite(tflite) invoke error after resize the input dimension

一世执手 提交于 2021-02-08 10:46:42

问题


I am using mobilenet_ssd.tflite as the mode from the official tensorflow github. Code below:

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

This will cause error when calling :

interpreter->AllocateTensors()

If I comment out the interpreter->ResizeInputTensor(input, sizes); Then every thing is fine.

Any suggestions?

Another question that I asked: change the input image size for mobilenet_ssd using tensorflow


回答1:


ResizeInputTensor is restricted by the neural network architecture. It fails since MobileNet & MobileNet SSD can only handle fixed size input.

The thing that may work is changing the batch size. For example, you can try to change the size from (1, 244, 244, 3) to (4, 244, 244, 3) and run inference on 4 images in one Invoke call.



来源:https://stackoverflow.com/questions/50735705/tensorflow-litetflite-invoke-error-after-resize-the-input-dimension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!