Forums - Tensor shape mismatch: input doesn't meet layer's tensor shape. Input Tensor shape does not match input layer shape

2 posts / 0 new
Last post
Tensor shape mismatch: input doesn't meet layer's tensor shape. Input Tensor shape does not match input layer shape
cannn1
Join Date: 8 Apr 20
Posts: 2
Posted: Tue, 2020-06-02 21:40

Hi,

When I try to run my SNPE model with batch_size > 1. I ended up with this error:

java.lang.IllegalStateException: Failed to forward propagate inputs! Cause: error_code=211; error_message=Tensor shape mismatch: input doesn't meet layer's tensor shape. Input Tensor shape does not match input layer shape: input0; error_component=Dl System; line_no=498; thread_id=522049361136

SNPE: 1.36

Model: converted from ONNX with size (1, 100, 100, 3). That means batch_size for my ONNX model is fixed to 1, but ONNX model works well with dynamic batch_size.

My purpose to use batch_size >1 to reduce running time. Instead of feed single image to SNPE model, I might want to feed 2 images in one forward.

Hope to have your idea to solve it!

Thanks in advance!

  • Up0
  • Down0
gesqdn-forum
Join Date: 4 Nov 18
Posts: 184
Posted: Tue, 2020-06-09 02:09

Hi

From your explanation, I understand that you would like to load two images to reduce the running time but the model inference is performed on only one image.


       computation time for feed with 2 images = computation time for feed with 1 image * 2
               Note: Verified in our environment with both scenarios (feeding 1 & 2 images to the network)


So, you may not find much difference in trying to compute forwarding 2 or more images at once.

Also, NPE does not support the dynamic batch size.
If you want to run your model with 2 images fed to the network, you need to convert your model again with shape (2,100,100,3).

Thank you, I hope this resolves your question.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.