android-demo-app
android-demo-app copied to clipboard
Failed to load Custom LSTM pytorch model in android
As i am trying to load custom pytorch lstm model in android studio using torch.load() .. it is throwing error which is mentioned below. Would anyone mind helping me out in this. What is the right way to load any custom model using torch.load() function.
Process: org.pytorch.helloworld, PID: 31234
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.helloworld/org.pytorch.helloworld.MainActivity}: com.facebook.jni.CppException: open file failed, file path: torchmoji.pt (FileAdapter at ../caffe2/serialize/file_adapter.cc:11)
(no backtrace available)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Caused by: com.facebook.jni.CppException: open file failed, file path: torchmoji.pt (FileAdapter at ../caffe2/serialize/file_adapter.cc:11)
(no backtrace available)
at org.pytorch.NativePeer.initHybrid(Native Method)
at org.pytorch.NativePeer.
Same question
Have you resolved this problem ?
I am facing the same issue, is there a way to resolve it