i.MX8 Tensorflow C++

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8 Tensorflow C++

Jump to solution
2,215 Views
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 Solution
2,126 Views
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

View solution in original post

0 Kudos
Reply
5 Replies
2,206 Views
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 Kudos
Reply
2,127 Views
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 Kudos
Reply
2,148 Views
weilly_li
Contributor IV

Hi, @Bio_TICFSL 

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

Weilly 

0 Kudos
Reply
2,165 Views
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 Kudos
Reply
2,194 Views
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 Kudos
Reply