Forums - multi input model conversion

5 posts / 0 new
Last post
multi input model conversion
andy.linluo
Join Date: 14 Aug 21
Posts: 10
Posted: Sat, 2023-07-15 14:04

Hi, i am trying to use snpe-onnx-to-dlc to convert an onnx model with 2 inputs. The argument --input_dim seems to support one input only.

Plesae let me know if there is any way to do it.

name: input_features

 

  • Up0
  • Down0
yunxqin
Join Date: 2 Mar 23
Posts: 44
Posted: Mon, 2023-07-17 19:32

Dear developer,

If you want to convert an onnx model with multiple inputs, you can use the commands like 'snpe-onnx-to-dlc --input_dim input1 'n,c,h,w' --input_dim input2 'n,c,h,w'.

BR.

Yunxiang

  • Up0
  • Down0
john_bh
Join Date: 13 Jun 23
Posts: 5
Posted: Tue, 2023-07-18 04:20

I also need two inputs, but I do not know how to write the raw.list?

  • Up0
  • Down0
john_bh
Join Date: 13 Jun 23
Posts: 5
Posted: Thu, 2023-07-20 20:39
I learn from the file: /SNPE/2.12.0.230626/docs/SNPE/html/general/tools.html#snpe-net-run ,  use the commands like 'snpe-pytorch-to-dlc --input_dim input1 'n,c,h,w' --input_dim input2 'n,c,h,w'
 
but I donot know how to use the command 'snpe-dlc-quantize' to quantize the model, and how to prepare the raw.list?
 
could give an example?
 
Thanks!
  • Up0
  • Down0
yunxqin
Join Date: 2 Mar 23
Posts: 44
Posted: Thu, 2023-07-20 23:04

Dear developer,

You can use it as below:

snpe-dlc-quantize --input_dlc model.dlc --input_list input_list.txt 

if you want to run on htp, you can add '--enable_htp' and you can specify the weights,act,bias by '--weights_bitwidth 8 --act_bitwidth 8 --bias_bitwidth 8'

And you can prepare input_list.txt as below:

input1:=input_data/input1.raw input2:=input_data/input2.raw

BR.

Yunxiang

 

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