i.MX8 Tensorflow C++

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX8 Tensorflow C++

跳至解决方案
3,084 次查看
weilly_li
Contributor IV

Hi, 

      Rencenly,  I want to compile C/C++ DEMO about label_image of Tensorflow .

      But This document getting information is too old , Can you tell me usage about tensorflow 2.4.1  ? Thank

PDF : NXP eIQ™ Machine Learning Software Development Environment for i.MX Applications Processors  

Weilly

1 解答
2,995 次查看
weilly_li
Contributor IV

Dear All,

I solved this problem about the newest bsp can't compile tensorflow DEMO issue by myself.

Please follow step

(1) Build BSP L5.10.35.2.0.0 SDK of i.MX8MPlus

      $ source ./imx-setup-release.sh -b bld-xwayland      $ Add in local.conf
         IMAGE_INSTALL_append += " packagegroup-imx-ml"
         TOOLCHAIN_TARGET_TASK_append += "tensorflow-lite-dev armnn-dev  onnxruntime-dev"
      $  bitbake -c populate_sdk imx-image-full
       Tip :  tensorflow-lite-staticdev package has some problem for this version 

 

(2) Install SDK

      $  cd /home/weilly/fsl-yocto-8mp/bld-xwayland/tmp/deploy/sdk
      $ ./fsl-imx-xwayland-glibc-x86_64-imx-image-full-cortexa53-crypto-imx8mpevk-toolchain-5.10-hardknott.sh

 

(3) Setting Environment

     $ source /opt/fsl-imx-xwayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux

 

(4) Download Tensorflow Lite Source Code

     $ git clone https://github.com/tensorflow/tensorflow 
     $ git checkout v2.4.0

 

(5) Compile Code

     $ cd /tensorflow/tensorflow/lite/examples/label_image
    $ $CC -o label_image_weilly 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 \
        -ltensorflow-lite -lstdc++ -lpthread -lm -ldl -lrt

   

here, Share.

Weilly

在原帖中查看解决方案

0 项奖励
回复
5 回复数
3,075 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Weilly_li

 

The documentation includes tensorflow 1.12v because is the version installed on the NU of the MX8MP, there is no actualization to 2.4v but in general the demo should work.

 

Regards

0 项奖励
回复
2,996 次查看
weilly_li
Contributor IV

Dear All,

I solved this problem about the newest bsp can't compile tensorflow DEMO issue by myself.

Please follow step

(1) Build BSP L5.10.35.2.0.0 SDK of i.MX8MPlus

      $ source ./imx-setup-release.sh -b bld-xwayland      $ Add in local.conf
         IMAGE_INSTALL_append += " packagegroup-imx-ml"
         TOOLCHAIN_TARGET_TASK_append += "tensorflow-lite-dev armnn-dev  onnxruntime-dev"
      $  bitbake -c populate_sdk imx-image-full
       Tip :  tensorflow-lite-staticdev package has some problem for this version 

 

(2) Install SDK

      $  cd /home/weilly/fsl-yocto-8mp/bld-xwayland/tmp/deploy/sdk
      $ ./fsl-imx-xwayland-glibc-x86_64-imx-image-full-cortexa53-crypto-imx8mpevk-toolchain-5.10-hardknott.sh

 

(3) Setting Environment

     $ source /opt/fsl-imx-xwayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux

 

(4) Download Tensorflow Lite Source Code

     $ git clone https://github.com/tensorflow/tensorflow 
     $ git checkout v2.4.0

 

(5) Compile Code

     $ cd /tensorflow/tensorflow/lite/examples/label_image
    $ $CC -o label_image_weilly 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 \
        -ltensorflow-lite -lstdc++ -lpthread -lm -ldl -lrt

   

here, Share.

Weilly

0 项奖励
回复
3,017 次查看
weilly_li
Contributor IV

Hi, @Bio_TICFSL 

      還有什麼方式可以幫忙解決嗎? 不然無法生出 SDK ~ 去編譯 Tensorflow ~感恩

Weilly 

0 项奖励
回复
3,034 次查看
weilly_li
Contributor IV

Hi, @Bio_TICFSL 

      i have confirmed add it . so I know this toolchian's problem of "tensorflow-lite-staticdev"

      BSP : L5.10.35.2.0.0

      Platform : NXP i.MX8MPlus 

tesnorflow-lite-satatucdev.png

Weilly

0 项奖励
回复
3,063 次查看
weilly_li
Contributor IV

Dear Bio_TICFSL,

Thank your reply!!  but I still need newest compile method of tensorflow c++ .
Today, I tryed compile label_image code using bazel, it can work on i.MX8M Plus. Unfortunately this method can't use NPU ....do you have some suggest ?

Weilly Li

0 项奖励
回复