1

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

miaout17
  • 4,715
  • 2
  • 26
  • 32
xhsoldier
  • 575
  • 6
  • 31

1 Answers1

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.

miaout17
  • 4,715
  • 2
  • 26
  • 32
  • MobileNet SSD can be resized by desktop tensorflow, I guess there is an operator that can not be handled by tflite. I want to re-implement that op in tflite. but I do not know which op does not support resize in tflite. tensorflow/contrib/lite/kernels/reshape.cc:68 num_input_elements != num_output_elements (17328 != 4332) – xhsoldier Jun 11 '18 at 02:54