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.15k stars 307 forks source link

Applying hint to executeNetwork not works #613

Closed Rahn80643 closed 2 years ago

Rahn80643 commented 2 years ago

Hi,

I'm trying to apply the "hint" mechanism for a tflite model to executeNetwork based on this issue, and I added the following code snippets to InferenceModel.hpp which is the attachment:

  1. The version of Armnn and Compute Library are 21.08
  2. [line 11] add header #include <armnn/IStrategy.hpp>
  3. [line 138] implement a class class VerifyActivationName and assigned the backend IDs to target layer types
  4. [line 362] create a VerifyActivationName object and utilize it with network->ExecuteStrategy(visitor);

However, executeNetwork fails to execute inference of the model, and the error occurs at network->ExecuteStrategy(visitor);. Is there a step omiited in the steps above? Screenshot

Best Regards, Rahn InferenceModel.hpp.txt

SadikARM commented 2 years ago

Hi @Rahn80643,

Could you try network->ExecuteStrategy(visitor); call on Line 373 after TfLite Parser parsed the model? After the TfLite Parser, Arm NN graph would be already built so ExecuteStrategy() call could visit all the layers in the network.

Best Regards, Sadik

Rahn80643 commented 2 years ago

Hi SadikARM,

I changed network->ExecuteStrategy(visitor); after TfLiter parser parsed the model and hint could be executed sucessfully.

Thank you!

Best Regards, Rahn