Hi guys,
It says that multiple output layers are supported in documents, when I set multiple output layers with code below:
zdl::DlSystem::StringList outputLayers = {}; outputLayers.append("BoxPredictor_0/box_encodings_0"); outputLayers.append("BoxPredictor_0/class_0"); outputLayers.append("BoxPredictor_1/box_encodings_1"); outputLayers.append("BoxPredictor_1/class_1"); outputLayers.append("BoxPredictor_2/box_encodings_2"); outputLayers.append("BoxPredictor_2/class_2"); outputLayers.append("BoxPredictor_3/box_encodings_3"); outputLayers.append("BoxPredictor_3/class_3"); const zdl::DlSystem::StringList outputNames = outputLayers; snpe = snpeBuilder.setOutputLayers(outputNames) .setDebugMode(true) .setRuntimeProcessor(runtime) .setUseUserSuppliedBuffers(useUserSuppliedBuffers) .build();
My network has 8 output layers, if outputNames is not empty I'll get NULL pointer for snpe,
if outputNames is empty, then snpe is set to the correct pointer, but it would only consider the final layer as output.
But I would like to set the 8 layers as output layers.
Does it a bug for SNPE SDK?
To debug the issue, I set debug mode to true, but it does not provide useful messages.
It seems that set output layers stringlist to {} is the only way to get it works.
Any comments would be appreciated! Thanks.
Hi,
I test setOutputLayers in snpe-sample example codes, when pass parameter to setOutputLayers, it would crash, android reports error logs listed below, it seems that setOutputLayers API is not support, but documents says the API should work.
So is it something that I missed or I set wrong paremeters?
Hope for detail reason, or is there a way to debug this issue?
01-05 13:08:42.310 15356-15356/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-05 13:08:42.311 15356-15356/? A/DEBUG: Build fingerprint: 'Xiaomi/gemini/gemini:7.0/NRD90M/7.9.14:user/release-keys'
01-05 13:08:42.311 15356-15356/? A/DEBUG: Revision: '0'
01-05 13:08:42.312 15356-15356/? A/DEBUG: ABI: 'arm64'
01-05 13:08:42.312 15356-15356/? A/DEBUG: pid: 15345, tid: 15345, name: snpe-sample >>> ./snpe-sample <<<
01-05 13:08:42.312 15356-15356/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
01-05 13:08:42.313 15356-15356/? A/DEBUG: x0 0000000000000000 x1 0000007fc3ac3668 x2 0000000000000003 x3 000000557ba2a7d4
01-05 13:08:42.313 15356-15356/? A/DEBUG: x4 0000000000000057 x5 4000000000000000 x6 0000000000800000 x7 7702ff514b4f79fe
01-05 13:08:42.313 15356-15356/? A/DEBUG: x8 0000007fc3ac3660 x9 0000007fa840c788 x10 0000000000000057 x11 0000000000000000
01-05 13:08:42.313 15356-15356/? A/DEBUG: x12 0000000000000001 x13 00000000ffffffff x14 00000000001eb180 x15 0000000000001fe3
01-05 13:08:42.314 15356-15356/? A/DEBUG: x16 000000557ba48c50 x17 0000007fa8bb0a18 x18 0000000000000000 x19 0000007fc3ac3688
01-05 13:08:42.314 15356-15356/? A/DEBUG: x20 000000557ba49000 x21 0000007fc3ac3900 x22 0000007fc3ac3660 x23 0000007fc3ac3638
01-05 13:08:42.314 15356-15356/? A/DEBUG: x24 0000007fc3ac3578 x25 0000007fc3ac36c0 x26 0000007fc3ac3588 x27 0000000000000001
01-05 13:08:42.314 15356-15356/? A/DEBUG: x28 0000000000000001 x29 0000007fc3ac3490 x30 000000557ba29c50
01-05 13:08:42.314 15356-15356/? A/DEBUG: sp 0000007fc3ac3490 pc 0000007fa8bb0a20 pstate 0000000020000000
01-05 13:08:42.312 15356-15356/? W/debuggerd64: type=1400 audit(0.0:306389): avc: denied { search } for name="tmp" dev="dm-1" ino=25 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
01-05 13:08:42.312 15356-15356/? W/debuggerd64: type=1400 audit(0.0:306390): avc: denied { search } for name="tmp" dev="dm-1" ino=25 scontext=u:r:debuggerd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
01-05 13:08:42.326 15356-15356/? A/DEBUG: backtrace:
01-05 13:08:42.327 15356-15356/? A/DEBUG: #00 pc 000000000009ba20 /data/local/tmp/libSNPE.so
01-05 13:08:42.327 15356-15356/? A/DEBUG: #01 pc 0000000000005c4c /data/local/tmp/snpe-sample
01-05 13:08:42.327 15356-15356/? A/DEBUG: #02 pc 000000000001a794 /system/lib64/libc.so (__libc_init+88)
01-05 13:08:42.327 15356-15356/? A/DEBUG: #03 pc 0000000000006790 /data/local/tmp/snpe-sample
I'm also use multiple output layer & my code is below.
layer name is changed....
==================================================
zdl::SNPE::SNPEBuilder snpeBuilder(container_.get());
Hi seewoo79,
I use SNPE SDK version 1.8.0, what about your version?
It seems that the differences between our code is the way how we declare outputList,
I use the way the example does: snpe=snpeBuilder.setOutputLayers({}), so I initialized outputList as '{}'.
In the doc of SNPE SDK 1.8.0, it says that when set en empty list to setOutputLayers, it would use only the final layer as the output layer.
Next week I would try your way to see if it works.
Thanks for sharing!
I tested my app for all version of SNPE (1.2.2 ~ 1.8.0) .
So your code works fine with all the versions?
Are there other different code may effect the multiple outputs?
I will test it on Monday.
Hi,
Finally I found that if I add tf.sigmoid to the layer output, then it can be used as the output layer.
Does your output layer's values are all between 0 ~ 1?
Does it mean that if all the output values must be normalized between 0 ~ 1?
No. my network has 2 output layers and one of them has output value range(0 ~ 700).
I just check that you use tf. maybe it is main difference....because I used caffe prototxt...
Yeah, I use tensorflow, and don't know why adding sigmoid to output would works.
Thanks for information.
Hi DamonZhou,
Have you solved this problem?
I am facing similar issue. My model has two output layers , I am doing the same way as you, but getting only one output tensor (final layer).
If you have solved the issue then kindly help me regarding this.
Thanks in Advance,
Kshama Vete