Tensorflow example not working on nRF Connect SDK

I have tried tensorflow example on nRF Connect SDK v1.6.1, v1.7.0 and v1.7.1 but all of them are not working.

To reproduce the behavior, build any example under zephyr\sample\modules\tensorflow

Here is the error from output console:

1> Compiling ‘model.cc’
2> Compiling ‘output_handler.cc’
4> ../src/main_functions.cc:19:10: fatal error: tensorflow/lite/micro/all_ops_resolver.h: No such file or directory
4> compilation terminated.
2> In file included from ../src/output_handler.cc:17:
2> ../src/output_handler.h:20:10: fatal error: tensorflow/lite/c/common.h: No such file or directory
2> compilation terminated.
Build failed

Parents Reply
  • I do not think Nordic have fixed this issue.
    I asked for help at tflite-micro repo, see https://github.com/zephyrproject-rtos/zephyr/discussions/52302

    I have my own Zephyr project with my own board based on nRF5340. I am using Zephyr v3.2.99-ncs2, nrf-sdk is v2.3.0.
    I modified NRF west.yml as suggested in tflite-micro repo:

    diff --git a/west.yml b/west.yml
    index a93676a6..5b16929e 100644
    --- a/west.yml
    +++ b/west.yml
    @@ -66,6 +66,7 @@ manifest:
             #
             # Please keep this list sorted alphabetically.
             name-allowlist:
    +          - tflite-micro
               - TraceRecorderSource
               - canopennode
               - chre

    I ran west update but I get no luck with adding CONFIG_TENSORFLOW_LITE_MICRO=y to my project.
    When I ran west -v update I noticed following line:


    west.manifest: project tflite-micro in file None ignored: an importing manifest blocked or did not allow it

    In my project west.yml I have added tflite-micro project:

        - name: tflite-micro
          path: zephyr/modules/tflite-micro
          revision: 8913f033772ac7009b6d8a1c8817e2399d22d803

    After west update I can see the sources of tflite-micro located in zephyr repo:

    <>/zephyr/modules/tflite-micro
    ./
    ../
    .bazelrc*
    .clang-format*
    .editorconfig*
    .git/
    .github/
    .gitignore*
    AUTHORS*
    BUILD*
    CMakeLists.txt*
    CODEOWNERS*
    CONTRIBUTING.md*
    Kconfig*
    LICENSE*
    README.md*
    SECURITY.md*
    WORKSPACE*
    ci/
    data/
    docs/
    python/
    tensorflow/
    third_party/

    However, I still could not set

    CONFIG_TENSORFLOW_LITE_MICRO=y

    Are you able to give some tips?

Children
Related