Hi guys,
I tried to run snpe-sample but failed with core dumped. I am a newbie and hope some suggestions from here.
cd $SNPE_ROOT/models/alexnet/data
$SNPE_ROOT/examples/NativeCpp/SampleCode/obj/local/x86_64-linux-clang/snpe-sample -b ITENSOR -d ../dlc/bvlc_alexnet.dlc -i target_raw_list.txt -o output
-------------------------------------------------------------------
SNPE Version: 1.14.1.0
Segmentation fault (core dumped)
This is my directory architecture and steps to prepare inputs,
├──snpe
│ ├── caffe (git clone https://github.com/BVLC/caffe.git)
│ ├── onnx_modles (git clone https://github.com/onnx/models.git)
│ ├── snpe-1.14.1 (unzipped from snpe-1.1.4.1.zip)
1.compile snpe-sample on x86_64/linux
export CXX=g++
make -f Makefile.x86_64-linux-clang
2.generate *.dlc file
./snpe-1.14.1/bin/x86_64-linux-clang/snpe-onnx-to-dlc --model_path onnx_models/bvlc_alexnet/bvlc_alexnet/model.onnx --dlc_path ./snpe-1.14.1/models/alexnet/dlc/bvlc_alexnet.dlc
3.convert *.jpg to *.raw
python ./snpe-1.14.1/models/alexnet/scripts/create_alexnet_raws.py -i ./snpe-1.14.1/models/alexnet/data -o ./snpe-1.14.1/models/alexnet/data/cropped -m ./caffe/distribute/python/caffe/imagenet/ilsvrc_2012_mean.npy
4.generate target_raw_list.txt
(I didn't find this file in snpe-1.14.1 package and also didn't get any way how to create it from doc/html , so tried to do it by myself)
python ./snpe-1.14.1/models/alexnet/scripts/create_file_list.py -i ./snpe-1.14.1/models/alexnet/data/cropped -o ./snpe-1.14.1/models/alexnet/data/cropped/target_raw_list.txt -e *.raw
I am not sure these steps are correct or not. Can anybody do my a favor? Thanks so much.
I also ran the following command,
snpe-net-run --container dlc/bvlc_alexnet.dlc --input_list data/cropped/target_raw_list.txt
-------------------------------------------------------------------------------
Model String: N/A
SNPE v1.14.1.0
-------------------------------------------------------------------------------
Processing DNN Input: /home/yangfan34/workspace/study/snpe/snpe-1.14.1/models/alexnet/data/cropped/handicap_sign.raw
Size of input does not match network.
Expecting: 150528
Got: 154587
227*227*3 = 154587, that is the size of raw image. What does it mean by 150528?
Cheers,
fan
Hi Fan,
It seems your model doesn't have 227x227x3 input dimension. The input format is BGR interleaved floating point values. As the expecting is 150528 bytes, the model accepts 112x112x3 (112x112x3x4(float)=150,528). Please check your model with the command "snpe-dlc-info".
Also refer to the SNPE input format document: https://developer.qualcomm.com/docs/snpe/image_input.html
Thanks,
Jihoon
Hi Fan,
Did you try to convert from caffe model to dlc instead of ONNX? It seems there's something weird in ONNX model converter and inference runtime.
Thanks,
Jihoon
Hi Jihoon,
You are right.
I should call snpe-caffe-to-dlc, instead of snpe-onnx-to-dlc. I started my SNPE travel directly from https://developer.qualcomm.com/doc/snpe/index.html and missed "python ./model/alexnet/scripts/setup_alexnet.py", which was NOT mentioned in doc/snpe/xxx.html.
For other newbies, this link should be accessed first, https://developer.qualcomm.com/software/snapdragon-neural-processing-eng...
Please close this issue. Thanks so much.
Fan