Model Loading issue Android

I was loading and using my model in android app till yesterday but today my model is not loading.
I am using torch-1.4.0-Snapshot version.
Is there anything changed from last day that I should aware?

Hello @mohit7,
snapshot version is based on the latest master branch, it is possible that serialization etc. was changed in libtorch.

Did you try it with the retraced/rescripted model using the latest pytorch nightly?

Do you see any messages in logcat?

Also we have one recently resolved issue with our nightlies
(Crash, that happened if Tensor.fromBlob was called before Module loading):
Issue: https://github.com/pytorch/pytorch/issues/31419
Fix in master: https://github.com/pytorch/pytorch/commit/3a19980b78b6638235edef367784ecc3dc37e364
Nightlies are already republished.

That might be the reason of your Module loading issue.

Hi Ivan,

I am also facing same issue while loading model in android with pytorch nightly version. To reproduce this issue, I simply modified the build.gradle file in android ‘HelloWorldApp’ as follows

repositories {
//jcenter()
maven {
url “https://oss.sonatype.org/content/repositories/snapshots
}
}

dependencies {
implementation ‘androidx.appcompat:appcompat:1.1.0’

//implementation 'org.pytorch:pytorch_android:1.3.0'
//implementation 'org.pytorch:pytorch_android_torchvision:1.3.0'

implementation 'org.pytorch:pytorch_android:1.4.0-SNAPSHOT'
implementation 'org.pytorch:pytorch_android_torchvision:1.4.0-SNAPSHOT'

}

With this change, the app is not working. It is trowing an error

A*/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 28782 (orch.helloworld), pid 28782 (orch.helloworld)*

Thanks
VGS

This is a bug. Fix is https://github.com/pytorch/pytorch/pull/31582 . Should be available in the next nightly build. Sorry for the trouble.