You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
With a clone of the repo as of Aug 14, 2020, no modifications, the HelloWorld app crashes at launch trying to read the model.pt asset:
/AndroidRuntime: FATAL EXCEPTION: main
Process: org.pytorch.helloworld, PID: 6473
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.helloworld/org.pytorch.helloworld.MainActivity}: com.facebook.jni.CppException: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ../caffe2/serialize/inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at ../caffe2/serialize/inline_container.cc:132)
(no backtrace available)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: com.facebook.jni.CppException: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ../caffe2/serialize/inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at ../caffe2/serialize/inline_container.cc:132)
The crash is consistent even if I recreate the model with the trace_model script using a couple different versions of torch and torchvision:
With torch==1.6.0 torchvision==0.7.0, Run python trace_model.py, clean and launch, app crashes with same error.
With torch==1.4.0 torchvision==0.5.0, Run python trace_model.py, clean and launch, app crashes with same error.
It may be worth noting that I have multiple versions of the Android NDK installed and specify ndkVersion "21.1.6352462"
The text was updated successfully, but these errors were encountered:
I got the same error and was able to fix the problem by updating the dependencies. See my repo (https://github.com/suyashjoshi/android-demo-app) for this fixed version. I've also submitted a Pull Request to the main Android PyTorch repo with the fix : #87
Hello @SuyashJoshi
Can you help me , I am trying to load my custom model (xyz.pth) using the script
trace_model.py but getting this error
Is my model loading is correct ?
what should I do please help ............
With a clone of the repo as of Aug 14, 2020, no modifications, the HelloWorld app crashes at launch trying to read the model.pt asset:
The crash is consistent even if I recreate the model with the trace_model script using a couple different versions of torch and torchvision:
With
torch==1.6.0 torchvision==0.7.0
, Runpython trace_model.py
, clean and launch, app crashes with same error.With
torch==1.4.0 torchvision==0.5.0
, Runpython trace_model.py
, clean and launch, app crashes with same error.It may be worth noting that I have multiple versions of the Android NDK installed and specify
ndkVersion "21.1.6352462"
The text was updated successfully, but these errors were encountered: