nnstreamer / nntrainer

NNtrainer is Software Framework for Training Neural Network Models on Devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues when building NNtrainer for Android

KirillP2323 opened this issue · comments

Hello, I am setting up Android development for NNtrainer, I'm following instructions here: https://github.com/nnstreamer/nntrainer/blob/main/docs/how-to-run-example-android.md
I'm stuck on the build step. When I run ./tools/package_android.sh, the installation process is being stuck for about 20 minutes after lines Message: preparing blas, Message: preparing ml api and Message: preparing tflite, because either tflite backbone or interpreter is enabled. After a couple of hours, the build throws the following error:

$ ./tools/package_android.sh
...
Message: preparing tflite, because either tflite backbone or interpreter is enabled
Program flatc found: YES (/usr/bin/flatc)
Configuring nntrainer.pc using configuration
Configuring nntrainer.ini using configuration
meson.build:318: WARNING: The variable(s) 'MEMORY_SWAP_LOOKAHEAD' in the input file 'nntrainer.ini.in' are not present in the given configuration data.
Message: NNTRAINER_CONF_PATH=/home/CORP/k.paramonov/Projects/nnbuilder/nntrainer/builddir/android_build_result/conf/nntrainer.ini
Message: extra defines are:-DMIN_CPP_VERSION=201703L -DML_API_COMMON=1 -DNNSTREAMER_AVAILABLE=1 -DUSE_BLAS=1 -DBLAS_NUM_THREADS=1 -DNNTR_NUM_THREADS=1 -D__LOGGING__=1 -DENABLE_TEST=1 -DREDUCE_TOLERANCE=1 -DENABLE_TFLITE_BACKBONE=1
Configuring ccapi-ml-training.pc using configuration
Configuring capi-ml-training.pc using configuration
meson.build:346: WARNING: test is not supported in android build, test skipped
meson.build:358: WARNING: android app is not supported for now, building app skipped
meson.build:375: WARNING: android nnstreamer-filter and nnstreamer-trainer are not yet supported, building them is skipped
Message: compile flags are:-O3
Configuring Android.mk using configuration
Program ndk-build found: YES (/home/CORP/k.paramonov/Android/ndk/25.2.9519653/ndk-build)
Message: num processor are: 16
Message: building for android
Build targets in project: 1

Found ninja-1.10.0 at /usr/bin/ninja
~/Projects/nnbuilder/nntrainer/builddir ~/Projects/nnbuilder/nntrainer ~/Projects/nnbuilder/nntrainer
[1/2] Generating ndk-build with a custom command.
FAILED: jni/arm64-v8a 
/home/CORP/k.paramonov/Android/ndk/25.2.9519653/ndk-build NDK_LIBS_OUT=/home/CORP/k.paramonov/Projects/nnbuilder/nntrainer/builddir/jni -j16
Android NDK: ERROR:jni/Android.mk:tensorflow-lite: LOCAL_SRC_FILES points to a missing file    
Android NDK: Check that /home/CORP/k.paramonov/Projects/nnbuilder/nntrainer/builddir/tensorflow-2.3.0/tensorflow-lite/lib/arm64/libtensorflow-lite.a exists  or that its path is correct   
/home/CORP/k.paramonov/Android/ndk/25.2.9519653/build/core/prebuilt-library.mk:51: *** Android NDK: Aborting    . Stop.
ninja: build stopped: subcommand failed.

The long wait issue might be because of a proxy on my machine: connection eventually times out, and tensorflow-2.3.0 does not end up in builddir.
The usual meson build finishes successfully. I also tested the build on another machine without proxy issues, and it also finished successfully.

:octocat: cibot: Thank you for posting issue #2198. The person in charge will reply soon.

I found that the installation process uses wget, the issue was solved by adding ~/.wgetrc file with proxy.