Forums - How to write a user defined layer that is supported do quantization by snpe-dlc-quantize

2 posts / 0 new
Last post
How to write a user defined layer that is supported do quantization by snpe-dlc-quantize
zhaoyangstar
Join Date: 14 Apr 19
Posts: 23
Posted: Sun, 2019-04-28 02:53

Question: How to quantize a dlc file which includes user defined layers ?

Hi, I wrote a user defined layer called interp and it could run on 855 CPU model. But the inference time is too slow so I want to quantize the dlc by using snpe-dlc-quantize. It occured error and cannot quantize the dlc file.

$ $SNPE_ROOT/bin/x86_64-linux-clang/snpe-dlc-quantize --input_dlc=dlc/freespace_interp.dlc --input_list=data/cropped/raw_list.txt --output_dlc=dlc/freespace_interp_quantized.dlc

[INFO] InitializeStderr: DebugLog initialized.
[INFO] Reading DLC: dlc/PL1B-Seg_mergebn.dlc
[INFO] Writing intermediate model
[INFO] *** Loading images from input list: data/cropped/raw_list.txt***
[WARNING] NetworkTopology::populateNetworkDesc network desc inputs is empty. Does this network have data/input layer?
[ERROR] 1102 | Failed to obtain udl derived instance for layer psp.pool1.interp
[ERROR] Failed to obtain udl derived instance for layer psp.pool1.interp
[INFO] DebugLog shutting down.

Does user have to write the impl of quantization for user defined layers? If so, is there any tutorials about this?

snpe-dlc-quantize is a ELF 64-bit LSB executable so I cannot see the source code.

Thanks in advance!

  • Up0
  • Down0
zhaoyangstar
Join Date: 14 Apr 19
Posts: 23
Posted: Mon, 2019-04-29 04:42

I got it! In the SNPE SDK Limitations and Issues, it said:  The snpe-dlc-quantize tool cannot quantize models that contain UDL layers.  Note: these models can still be run on DSP runtime. The DSP runtime will quantize the network during network initialization.

So I could provide unquantized model at runtime but running with --use_gpu or --use_dsp to let runtime quantize the network during its initialization.

The post is closed.

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