Hi
I'm trying to use yolov5 with SNPE.
But I can't build my dlc model in runtime with following error.
2022-01-24 18:42:33.195 13721-13760/android.example.com.SNPEdemo E/AndroidRuntime: FATAL EXCEPTION: CameraBackgroundProcess: android.example.com.SNPEdemo, PID: 13721com.qualcomm.qti.snpe.SnpeError$NativeException: Unable to create network! Cause: error_code=902; error_message=Layer parameter value is invalid in DSP. error_code=902; error_message=Layer parameter value is invalid in DSP. Layer Reshape_259: Maximum number of output dimensions(4) exceeded. 5 output dimension were given for DSP runtime.; error_component=DSP Runtime; line_no=101; thread_id=485011494128; error_component=DSP Runtime; line_no=265; thread_id=485064963312at com.qualcomm.qti.snpe.SnpeError.getSnpeNativeError(SnpeError.java:35)at com.qualcomm.qti.snpe.internal.NativeNetwork.<init>(NativeNetwork.java:83)at com.qualcomm.qti.snpe.SNPE$NeuralNetworkBuilder.build(SNPE.java:414)at com.example.android.SNPEdemo.models.ObjectDetectorQuantizedYoloV5_SNPE.<init>(ObjectDetectorQuantizedYoloV5_SNPE.java:119)at com.example.android.SNPEdemo.Camera2BasicFragment.lambda$updateActiveModel$0$Camera2BasicFragment(Camera2BasicFragment.java:466)at com.example.android.SNPEdemo.-$$Lambda$Camera2BasicFragment$y8biyD425r7lo-ZVHRFV-5g-v5k.run(Unknown Source:8)at android.os.Handler.handleCallback(Handler.java:873)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:193)at android.os.HandlerThread.run(HandlerThread.java:65)
I read that SNPE does not support 5D input data. But this error happens in intermediate layer not in input layer.
Does SNPE not support 5D data in any intermediate layers or just did I messed up something?
Thank you
Hi byunghwy.choi,
Are you using a DSP as Runtime?
If Yes, Can you please try using other Runtime than DSP?
Please let me if issue persist with other Runtime also.
Regards,
Sahil Bandar
Hi Sahil Bandar.
It works perfectly well with CPU runtime but I got the following error with GPU runtime:
2022-02-03 17:02:02.474 E/AndroidRuntime: FATAL EXCEPTION: CameraBackground
at android.os.HandlerThread.run(HandlerThread.java:65)
Mul_268 layer has input and output shape of [1x3x24x40x2], which is also 5-dimension.
After I saw this error, I checked my model with snpe-dlc-info layer by layer .
It says Reshape_259 layer, which caused problem with DSP, does not support DSP runtime, it supports only GPU and CPU. In facts, every layer with 5-dimension output did not support AIP and DSP, and elementwise_binary_op layer with 5-dimension output supported only CPU.
Okey, maybe SNPE does not support full operations in every processor if they have 5-dimension output, but what matters to me is how I can utilize my hardware resources. If reshape layer does not support DSP, I can use GPU. If elementwise_binary_op does not support GPU, I can use CPU.
So my question is, is there any method to utilize multiple runtimes in one neural network?
I set runtime order as following, but it doesn't seem to utilize multiple runtime. It just check the resources are available or not and choose the top of the list.
Exactly the same error. I faced it on c++_android version.
I'm using SNPE 1.58.00, have you tried it under 1.59.00?
It seems like that I need to change the model of yolov5, which is tricky.
Did you fixed it? Or do you have any idea?
I'm also using 1.58.00.
I couldn't find any solution to utilize DSP for yolov5 in SNPE, so I'm just using tensorflow lite with GPU instead.
My application uses multiple neural network model simultaneously, and some of them have only 4-dimension input and output for every layer, so I'm utilizing SNPE DSP for those models instead of yolov5.
SNPE do have some restrictions compared to tensorflow lite, but I believe that quantization tool of SNPE shows less accuracy drop than that of tensorflow lite.
Currently I'm using both SNPE and tensorflow lite: SNPE for int8 quantized model, tensorflow lite for FP32 model
I hope SNPE supports 5-dimension data soon enough.