Error "" not found while executing model on Android device

Steps followed:

python3 -m tvm.driver.tvmc compile --target “llvm -device=arm_cpu -mtriple=aarch64-linux-gnu” --cross-compiler ‘aarch64-linux-gnu-gcc’ -o resnet50-v2-7-tvm-arm64CPU.tar …/resnet50-v2-7.onnx

  • The compiled models got generated in resnet50-v2-7-tvm-arm64CPU.tar.
  • When tested on Android device using the android_deploy test app with the generated TVM compiled model files(, mod.json, mod.params) we get the following error:

09-30 17:04:23.148 8538 8582 E AndroidRuntime: Caused by: org.apache.tvm.Base$TVMError: TVMError: Check failed: lib_handle_ != nullptr: Failed to load dynamic shared library /data/user/0/ dlopen failed: library “” not found: needed by /data/data/ in namespace classloader-namespace

There is no library found in the Android /system/ folder.

Is the steps followed are correct or we need to using a different cross-compiler toolchain for Android?

The issue is resolved by downloading the latest Android NDK and giving Clang compiler for cross-compilation.

tvmc compile --target “llvm -device=arm_cpu -mtriple=aarch64-linux-android” --cross-compiler ‘$ANDROID_NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang’ -o mobilenet_v2_pytorch_arm64_cpu.tar models/mobilenet_v2_pytorch.onnx