Model Loading issue in android

My model contains nn.Functional.interpolate layer and it is converted properly to .pt model using jit.
But Loading same model in android giving issues.
This is happening in case of interpolate layer only.

Edit - Error trace

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.custom_model/org.pytorch.custom_model.MainActivity}: com.facebook.jni.CppException: false CHECK FAILED at …/c10/core/Backend.h (tensorTypeIdToBackend at …/c10/core/Backend.h:106)
(no backtrace available)

Provide a stacktrace please

Hey @zetyquickly I have edit the trace in the post. Kindly look into it

The most common reason for this is version discrepancies between the PyTorch version you trace the model with and the PyTorch Mobile one.

Best regards

Thomas

Hi @tom , I am using pytorch_android 1.3.1 and pytorch android torchvision 1.3.1
and pytorch version 1.3.1 cpu. I didn’t find any discrepancies for versions.
Can you enlighten more?

Thanks
Mohit Ranawat

1 Like

Hi@mohit7,I meet the same problem as you. Now I am trying to retrain the model with pytorch 1.3.If you have solved the problem, I hope you can give me some advice, thank you. You can contact with me. My email address is 1209648713@qq. com.

Hi @Janice_w I didn’t got any solution yet. Hope I’ll get the solution.
If you got the solution tell me

I meet this problem too(on iOS though). The model I use is from here but I use my own images for SRGAN.


P.S. I tried onnx->coreml and onnx->tensorflow pb -> coreml and both way failed. Very frustrated as a beginner.

hey @kunstlicheSeele onnx to tensorflow conversion is not stable.
Better to not use it.You can go fro keras to tensorflow and you can transfer your weights from pytorch to keras.
Hope this helps.
Thanks,
Mohit Ranawat

1 Like

For anyone who is following this thread, the issue was resolved at https://github.com/pytorch/pytorch/issues/29806