问题
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