ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.14k stars 307 forks source link

Unable to run inference on Blaze Pose tflite model #649

Closed aymanchaudhry closed 2 years ago

aymanchaudhry commented 2 years ago

Hi, I'm currently using ArmNN v22.02 alongside TensorFlow Lite v2.5.3. I've tried to run ExecuteNetwork on a float32 Blaze Pose model, however, I receive the following error:

/usr/bin/armnn/examples/ExecuteNetwork$ ./ExecuteNetwork -c CpuAcc -f tflite-binary -m /pose_landmark_lite.tflite -i input_1 -o indentity,indentity_1,indentity_2,indentity_3,indentity_4 -d ../images/rsz_grace_hopper.csv
Info: ArmNN v28.0.0
Info: Initialization time: 28.63 ms.
Error: Failed to parse operator #3 within subgraph #0 error: Buffer #0 has 0 bytes. For tensor: [24,3,3,3] expecting: 2592 bytes and 648 elements.  at function CreateConstTensorNonPermuted [/usr/src/debug/armnn/22.02-r0/git/src/armnnTfLiteParser/TfLiteParser.cpp:4317]
Fatal: Armnn Error: Failed to parse operator #3 within subgraph #0 error: Buffer #0 has 0 bytes. For tensor: [24,3,3,3] expecting: 2592 bytes and 648 elements.  at function CreateConstTensorNonPermuted [/usr/src/debug/armnn/22.02-r0/git/src/armnnTfLiteParser/TfLiteParser.cpp:4317]
Info: Shutdown time: 1.27 ms. 

Using Netron, it looks as if the model uses the Weights and Biases as inputs to the Conv2d layer. blaze-pose-lite

I have seen there has been similar issue reported which have been closed due to it being put as a feature request - #506 .

Has this feature been implemented, or will it be included in an upcoming Arm NN release?

Model sourced from: https://github.com/google/mediapipe/blob/master/mediapipe/modules/pose_landmark/pose_landmark_lite.tflite

Kind Regards, Ayman

ghost commented 2 years ago

Hey aymanchaudhry

This is due to a quirk in how the Dequantize layers in the model store their data. Each of those Dequantize layers contain their own data to then be Dequantized. Which our 22.02 release is not equipped to handle as we don't support Const Tensors as inputs for Conv2d. But we do have a fix for it which will be in our upcoming 22.05 release. This should fix the error you are seeing above. 22.05 is expected to be released on the 27th of May.

Regards, David

aymanchaudhry commented 2 years ago

Hi David,

Thanks for letting me know!

Kind Regards, Ayman

ghost commented 2 years ago

Hey Ayman,

Can you let me know if the 22.05 release fixed your issue, otherwise I'll be closing this off as fixed.

Kind regards, David

aymanchaudhry commented 2 years ago

Hi David,

I have not had a chance to upgrade to the latest release (v22.05) yet.

Please feel free to close this issue and I'll re-open if I face any issues when I get a chance to upgrade and test.

Thanks for the help!

Kind Regards, Ayman