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