I'm trying to run an object detection model using PyTorch Mobile in Android Studio, but I'm getting this error: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/ai.isazi.android.brandi.distribution-d262fPg6Kfh8SoY_fVmG7w==/base.apk"],nativeLibraryDirectories=[/data/app/ai.isazi.android.brandi.distribution-d262fPg6Kfh8SoY_fVmG7w==/lib/arm64, /data/app/ai.isazi.android.brandi.distribution-d262fPg6Kfh8SoY_fVmG7w==/base.apk!/lib/arm64-v8a, /system/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]] couldn't find "libpytorch_jni.so"
when loading the model file as follows:
val objectDetector: Module = Module.load(assetFilePath(this, "model.pt")
This is how the dependencies in my build.grade file looks:
implementation fileTree(dir: "libs", include: ["*.jar"])implementation 'org.pytorch:pytorch_android_lite:1.9.0'implementation 'org.pytorch:pytorch_android_torchvision:1.9.0
Any help or suggestions would be greatly appreciated
Hi
I'm trying to run an object detection model using PyTorch Mobile in Android Studio, but I'm getting this error:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/ai.isazi.android.brandi.distribution-d262fPg6Kfh8SoY_fVmG7w==/base.apk"],nativeLibraryDirectories=[/data/app/ai.isazi.android.brandi.distribution-d262fPg6Kfh8SoY_fVmG7w==/lib/arm64, /data/app/ai.isazi.android.brandi.distribution-d262fPg6Kfh8SoY_fVmG7w==/base.apk!/lib/arm64-v8a, /system/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]] couldn't find "libpytorch_jni.so"
when loading the model file as follows:
val objectDetector: Module = Module.load(assetFilePath(this, "model.pt")
This is how the dependencies in my build.grade file looks:
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'org.pytorch:pytorch_android_lite:1.9.0'
implementation 'org.pytorch:pytorch_android_torchvision:1.9.0
Any help or suggestions would be greatly appreciated