I.MX8M plus AI Robot platform tensor flow lite NNAPI accelerate issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I.MX8M plus AI Robot platform tensor flow lite NNAPI accelerate issue

ソリューションへジャンプ
1,600件の閲覧回数
刘国华
Contributor III

@xiaodong_zhang 

Dear xiaodong 

  I compile the 5.4.70 AI robot ROS image using the command "bitbake imx-robot-sdk" ,and I update the OS image with UUU tool, i can brinig up the AI robot EVK successully . 

Then I use the command "bitbake imx-robot-system -c populate_sdk" to generate the SDK , i have installed the SDK in my X86 ubuntu 18.04 . 

Then I download the tensorflow lite v2.3.1 source code :

git clone https://github.com/tensorflow/tensorflow.git

git checkout v2.3.1

cd /4Tdisk/king/NXP/King_application/tensorflow/tensorflow/lite/examples/label_image/

Compiled the label_image successfully using the command below :

$CC label_image.cc bitmap_helpers.cc ../../tools/evaluation/utils.cc -I=/usr/include/tensorflow/lite/tools/make/downloads/flatbuffers/include \

-I=/usr/include/tensorflow/lite/tools/make/downloads/absl -O1 -DTFLITE_WITHOUT_XNNPACK -ltensorflow-lite -lstdc++ -lpthread -lm -ldl -lrt

 

After i get the label_image output application a.out , I copy it to the AI robot EVK .

It can run successufly using the CPU  .

刘国华_1-1623378865346.png

 

But can not use the NNAPI accelerate . 

 

刘国华_0-1623378816389.png

 

But the Yocot pre-build label_image can use the NNAPI accelerate .

刘国华_2-1623378957615.png

 

How can i debug this issue?

 

 

 

タグ(1)
0 件の賞賛
1 解決策
1,585件の閲覧回数
xiaodong_zhang
NXP Employee
NXP Employee

@刘国华 

Maybe you miss -DTFLITE_ENABLE_NNAPI=on

元の投稿で解決策を見る

0 件の賞賛
5 返答(返信)
1,586件の閲覧回数
xiaodong_zhang
NXP Employee
NXP Employee

@刘国华 

Maybe you miss -DTFLITE_ENABLE_NNAPI=on

0 件の賞賛
1,525件の閲覧回数
刘国华
Contributor III

@xiaodong_zhang 

We must use the label_image source code located in the yocto bitbake path , then it can use the NNAPI acceleration . 

For the label_image source code download from tensorflow lite website , it is different from the one in Yocto BSP . 

940件の閲覧回数
bret_harte
Contributor I

Can you be more specific where I can find the version of label_image source code that works with NNAPI acceleration, thanks.

0 件の賞賛
1,593件の閲覧回数
xiaodong_zhang
NXP Employee
NXP Employee

@刘国华 

   Current i.MX Yocto don't support Tensorflow with NPU accelerate(I don't think it will be supported in future). You need to add tensorflow-lite into  variable IMAGE_INSTALL in imx-robot-sdk.bb when you want to deploy model trained and converted by TensorFlow tools.

BTW, I already add ML packages (include tensorflow-lite) in imx-robot-sdk.bb in last i.MX robot platform.

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-%E6%9C%BA%E5%99%A8%E4%BA%BA%E5%B9%B...

Please the below update

/////////////////////////////////////// update for v1.0-L5.4.70-2.3.2  ///////////////////////////////////////////////////////////

 

0 件の賞賛
1,575件の閲覧回数
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Good

 

0 件の賞賛