【问题标题】:failed to install TensorFlow Lite using ck framework使用 ck 框架安装 TensorFlow Lite 失败
【发布时间】:2018-07-07 15:02:59
【问题描述】:

我在http://cknowledge.org/shared-programs.html#image-classification-tflite 找到了一个使用 TensorFlow Lite 对图像进行分类的程序。我正在关注提供的自述文件,但在为 android23 安装 lib-tflite-1.7.0-src-static 包时卡住了 - ck 框架没有找到我的 android ndk:

plam@mrk-23:~$ ck install package:lib-tflite-1.7.0-src-static --target_os=android23-arm64

  -----------------------------------
  Resolving software dependencies ...

*** Dependency 1 = compiler (C++ compiler):

 ********
 WARNING: no registered CK environment was found for "C++ compiler" dependency with tags="compiler,lang-cpp" and setup={"target_os_bits": "64", "host_os_uoa": "linux-64", "target_os_uoa": "android23-arm64"}

  Trying to automatically detect required software ...

  1) Checking if "Android NDK GCC compiler" (compiler.gcc.android.ndk / bfc4274b1d8f83bb) is installed ...

  Searching for Android NDK GCC compiler (ndk-build) to automatically register in the CK - it may take some time, please wait ...

    * Searching in /usr ...
    * Searching in /opt ...
    * Searching in /home/plam ...

  Search completed in 2.1 secs. Found 0 target files (may be pruned) ...
  (warning during intermediate step: software was not automatically found on your system! Please, install it and re-try again!)

  2) Checking if "Android NDK LLVM compiler" (compiler.llvm.android.ndk / 47b0a9cd88368dc6) is installed ...

  -----------------------------------
  Resolving software dependencies ...

*** Dependency 1 = ndk-gcc (Android NDK GCC):

 ********
 WARNING: no registered CK environment was found for "Android NDK GCC" dependency with tags="compiler,gcc,ndk" and setup={"target_os_bits": "64", "host_os_uoa": "linux-64", "target_os_uoa": "android23-arm64"}

  Trying to automatically detect required software ...

  1) Checking if "Android NDK GCC compiler" (compiler.gcc.android.ndk / bfc4274b1d8f83bb) is installed ...

  Searching for Android NDK GCC compiler (ndk-build) to automatically register in the CK - it may take some time, please wait ...

    * Searching in /usr ...
    * Searching in /opt ...
    * Searching in /home/plam ...

  Search completed in 2.1 secs. Found 0 target files (may be pruned) ...
  (warning during intermediate step: software was not automatically found on your system! Please, install it and re-try again!)
    No software auto-detection scripts found for this software in CK :( ...

       Checked following related CK soft entries:
        * compiler.gcc.android.ndk

  Searching and installing CK software packages ...
    * tags:        compiler,gcc,ndk
    * or tags:
    * no tags:

    CK packages are not found for this software :( !

****** Installation notes: ******
You can download and install Native Android NDK for your platform from
* http://developer.android.com/ndk/downloads/index.html

You can also download CrystaX NDK (extra libs and improved C++ support) from
* https://www.crystax.net/en/download


*********************************
       Would you like to manually register software, i.e. if it is in an unusual path (y/N):

  (warning during intermediate step: no registered CK environment was found for "Android NDK GCC" dependency with tags="compiler,gcc,ndk" and setup={"target_os_bits": "64", "host_os_uoa": "linux-64", "target_os_uoa": "android23-arm64"})
    No software auto-detection scripts found for this software in CK :( ...

       Checked following related CK soft entries:
        * compiler.gcc.milepost
        * compiler.icc
        * compiler.ctuning-cc
        * compiler.microsoft
        * compiler.open64
        * compiler.gcc
        * compiler.gcc.android.ndk
        * compiler.llvm
        * compiler.llvm.android.ndk
        * compiler.pgi

  Searching and installing CK software packages ...
    * tags:        compiler,lang-cpp
    * or tags:
    * no tags:

    CK packages are not found for this software :( !

       Would you like to open wiki pages about related software (with possible installation info) (y/N):

CK error: [package] no registered CK environment was found for "C++ compiler" dependency with tags="compiler,lang-cpp" and setup={"target_os_bits": "64", "host_os_uoa": "linux-64", "target_os_uoa": "android23-arm64"}!

我认为是因为android ndk安装在我们集群上一个不常见的地方:/misc/android-ndk-r17b

有谁知道如何告诉这个 ck 框架在不标准的地方检测我的 android ndk?我使用 Ubuntu 18.04 并从 https://github.com/ctuning/ck 的 GitHub 安装 ck。

非常感谢!

【问题讨论】:

    标签: android tensorflow


    【解决方案1】:

    您必须首先帮助 CK 在非正常路径中从 Android NDK 中检测您的 GCC,如下所示:

    $ ck detect soft:compiler.gcc.android.ndk --target_os=android23-arm64 --search_dirs=<<INSTALLATION PATH OF ANDROID NDK>>
    

    然后您可以检查 CK 是否将您的 Android NDK 注册为虚拟环境,如下所示:

    $ ck show env --target_os=android23-arm64
    $ ck virtual env --tags=android,ndk,gcc --target_os=android23-arm64
    

    您现在应该可以按如下方式重新启动 TensorFlow 的安装:

    $ ck install package:lib-tflite-1.7.0-src-static --target_os=android23-arm64
    $ ck compile program:image-classification-tflite --target_os=android23-arm64 --speed
    $ ck run program:image-classification-tflite --target_os=android23-arm64
    

    您还可以通过以下类似方式从 Android NDK 中检测 Clang:

    $ ck detect soft:compiler.llvm.android.ndk --target_os=android23-arm64 --search_dirs=<<INSTALLATION PATH OF ANDROID NDK>>
    

    但我不确定它是否适用于上述 tflite 包 - 你可以尝试...

    如果您需要,可以在这里找到其他可以被CK检测到的软件:http://cKnowledge.org/shared-soft-detection-plugins.html

    顺便说一句,我建议在 CK 邮件列表或 Slack 频道中提出此类问题 - 你可能会更快地获得帮助:https://github.com/ctuning/ck/wiki/Contacts

    【讨论】:

    • gfursin,感谢您的详细回答,它对我有用。
    猜你喜欢
    • 2021-01-17
    • 2018-05-09
    • 2018-05-20
    • 1970-01-01
    • 1970-01-01
    • 2017-03-26
    • 1970-01-01
    • 1970-01-01
    • 2018-01-11
    相关资源
    最近更新 更多