Forums - Preserve NCHW format in onnx to dlc conversion

4 posts / 0 new
Last post
Preserve NCHW format in onnx to dlc conversion
mankaran32
Join Date: 16 May 21
Posts: 2
Posted: Sun, 2023-03-12 07:27

I am trying to convert onnx model with input shape 1x12x128x256, but the converted model has shape 1x128x256x12. I want to preserve the NCHW format. I want snpe to add the permute layer if it wants but not change the input dimension ordering. How can this be done ? 

I have tried all snpe version > 1.5. Also tring specifying input layout as well as input dims but no luck at  all.

  • Up0
  • Down0
v.bathini
Join Date: 27 Feb 22
Posts: 11
Posted: Tue, 2023-03-14 22:33
Hi makaran32 you can use the --input-reshape command line option to specify the input shape in nchw format explicitly Example command snpe-onnx-to-dlc --input_network_shape NCHW,1,12,128,256 --input-reshape NCHW,1,12,128,256 --output_node output_node_name --output_network_path output.dlc input.onnx
  • Up0
  • Down0
mankaran32
Join Date: 16 May 21
Posts: 2
Posted: Fri, 2023-03-17 03:19

There is no `input-reshape` option. which snpe release are you talking about ? I am using 2.7.0. Earlier releases dont have this option either. 

  • Up0
  • Down0
v.bathini
Join Date: 27 Feb 22
Posts: 11
Posted: Mon, 2023-03-20 22:21
The input-reshape option available for snpe version 1.26.0
  • 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.