无法使用ck框架安装TensorFlow Lite

时间:2018-07-07 15:03:00

标签: android tensorflow

我在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。

非常感谢!

1 个答案:

答案 0 :(得分:0)

您必须首先帮助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