I converted my Caffe model to .dlc using the conversion tool, then I run the .dlc on PC and on a Linux board (development kit with Snapdragon 626). I used the x86_64-linux-clang/libSNPE on the PC and the arm-linux-gcc4.9sf/libSNPE on the Linux board.
I noticed that the output of the SNPE .dlc (both from PC and from the Linux board) are all different from the direct output from Caffe. The total data size is the same but the floating-point values are all off.
- From Caffe, the max/min is 1.013/-0.016 and results in correct classifications.
- From SNPE (PC and board), the max/min is nan/nan, with most of the values approaching either positive inf or negative inf. Obviously this results in very incorrect classification results.
All other aspects are the same. The only difference between the output is that one is from Caffe and one is from SNPE. I am using SNPE 1.27.1.382. I am thinking that this is a SNPE issue because the direct Caffe output classification is correct.
I realize that it is quite difficult for anyone to debug this without sharing the model, but I would appreciate any ideas on which part to check.
Hi gino0,
I guess it's caused from the input axis order difference between Caffe and SNPE. Caffe uses BCHW scheme while SNPE uses BHWC. Once you correct this, your output result would be okay.
Refer to following document.
https://developer.qualcomm.com/docs/snpe/image_input.html
Thanks,
jihoonk
Thanks for the tip.
Yes, I think I got my axes wrong. I fixed the input raw image to SNPE to reshape to BxHxWxC, then I also made sure I am parsing the 1D output of SNPE also as BxHxWxC.
The SNPE output is now back to non-infinity/NaN values.