I want to build an android using my own deep learning network. But i change the code in tvm/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java
the code I change as follow:
private static final int MODEL_INPUT_SIZE = 512;
private static final String MODEL_GRAPH_FILE = “file:///android_asset/my_mlp-symbol.json”;
private static final String MODEL_PARAM_FILE = “file:///android_asset/my_mlp-0000.params”;
private static final String MODEL_LABEL_FILE = “file:///android_asset/my_mlp.shortnames.list”;
and the document ‘my_mlp-symbol.json’, ‘my_mlp-0000.params’ and ‘my_mlp.shortnames.list’ are the network structure, parameters, and the label document
I can use gradle to build the APK, but after installation, the APP can’t open.
Who can help me ?
Thank you
System:
ubuntu 18.04
Gradle 5.0
LLVM 6.x
gcc and g++ 6.x
Apache Maven 3.5.2
Docker version 18.09.0
~Android/Sdk:NDK16.1
But I met some trouble like those:
acui@OFShare:~/tvm/tvm/apps/android_deploy$ gradle clean build
> Task :app:buildJni
/home/acui/tvm/tvm/apps/android_deploy/app/src/main/jnistrong text
Android NDK: WARNING: APP_PLATFORM android-17 is higher than android:minSdkVersion 1 in /home/acui/tvm/tvm/apps/android_deploy/app/src/main/AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-17. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.
make: Entering directory `/home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni'
/home/acui/Android/Sdk/ndk-bundle/build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): mips64 armeabi mips
/home/acui/Android/Sdk/ndk-bundle/build/core/setup-app.mk:82: Android NDK: Support for these ABIs will be removed in a future NDK release.
[arm64-v8a] Compile++ : tvm4j_runtime_packed <= ml_dmlc_tvm_native_c_api.cc
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/ml_dmlc_tvm_native_c_api.cc:8:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/tvm_runtime.h:9:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../include/../src/runtime/c_runtime_api.cc:9:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../include/tvm/runtime/packed_func.h:18:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../include/tvm/runtime/module.h:11:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../3rdparty/dmlc-core/include/dmlc/./io.h:445:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../3rdparty/dmlc-core/include/dmlc/./serializer.h:22:
/home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../3rdparty/dmlc-core/include/dmlc/./endian.h:26:6: error: "Unable to determine endianness of your machine; use CMake to compile"
#error "Unable to determine endianness of your machine; use CMake to compile"
^
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/ml_dmlc_tvm_native_c_api.cc:8:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/tvm_runtime.h:9:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../include/../src/runtime/c_runtime_api.cc:9:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../include/tvm/runtime/packed_func.h:18:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../include/tvm/runtime/module.h:11:
In file included from /home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../3rdparty/dmlc-core/include/dmlc/./io.h:445:
/home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../3rdparty/dmlc-core/include/dmlc/./serializer.h:85:9: error: use of undeclared identifier 'DMLC_LITTLE_ENDIAN'
if (DMLC_IO_NO_ENDIAN_SWAP) {
^
/home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni/../../../../../../3rdparty/dmlc-core/include/dmlc/./endian.h:32:33: note: expanded from macro 'DMLC_IO_NO_ENDIAN_SWAP'
#define DMLC_IO_NO_ENDIAN_SWAP (DMLC_LITTLE_ENDIAN == DMLC_IO_USE_LITTLE_ENDIAN)
.......
omitted
.......
17 errors generated.
make: *** [/home/acui/tvm/tvm/apps/android_deploy/app/src/main/obj/local/arm64-v8a/objs/tvm4j_runtime_packed/ml_dmlc_tvm_native_c_api.o] Error 1
make: Leaving directory `/home/acui/tvm/tvm/apps/android_deploy/app/src/main/jni'
> Task :app:buildJni FAILED
FAILURE: Build failed with an exception.
on above outputs of errors,I noticed " #error “Unable to determine endianness of your machine; use CMake to compile” so I vim this tvm/apps/android_deploy/app/src/main/jni/Application.mk file and changed only one line of this: