Forums - Mistmatch output network before and after conversion

2 posts / 0 new
Last post
Mistmatch output network before and after conversion
jacques.delfrate
Join Date: 30 May 22
Posts: 2
Posted: Tue, 2022-06-28 13:22

Hi,

I have a network of 3 layers built using Pytorch:

nn.Linear(576, 128)
nn.PReLU(128)
nn.Linear(128, 4)

Input Dimension is [54, 576] and output Dim is [54, 4].

I export the model using torch.onnx.export() with flag export_params=True, then it is converted using snpe-onnx-to-dlc script.

python3 ./snpe-onnx-to-dlc ./reverse_last_branch.onnx --output_path ./reverse_last_branch.dlc --input_dim input "54,576" --out_name output

 

However for a same tensor of [54, 576] I am not able to get the same output before and after conversion to dlc format. 

Do you have an idea why ?
 


Note that I have been able to get the same output for other models and each of those 3 layers return the exact same output after conversion when exported individually.

 

Thanks.

 

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 103
Posted: Sat, 2022-07-09 19:34

Dear customer,

What's type of your model executed, float or fixed?

Regarding the onnx framework, the dimension format is NCHW but SNPE processed the encoding of NHWC. According to that info, you need to convert output tensor from NCHW(SNPE) to NHWC(onnx) for your end comparison.

BR.
Wei

  • 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.