pytorch / android-demo-app

PyTorch android examples of usage in applications
1.45k stars 596 forks source link

fix "Lite Interpreter verson number does not match" #271

Open doutv opened 1 year ago

doutv commented 1 year ago

Fix the bug in Issue #202

When I run HelloWorldApp, I met this error: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pytorch.helloworld/org.pytorch.helloworld.MainActivity}: com.facebook.jni.CppException: Lite Interpreter verson number does not match. The model version must be between 3 and 5But the model version is 8 ()

My solution:

  1. Specify the LTS version (can be found here) of torch and torchvision when running pip install. I also add a requirements.txt here.
  2. Upgrade org.pytorch:pytorch_android_lite and org.pytorch:pytorch_android_torchvision_lite to latest version 1.12.2.
  3. I also update README corresponding to the above changes.
HripsimeS commented 1 year ago

@doutv Hello. I am getting the following error and I don't know how to fix it. com.facebook.jni.CppException: Lite Interpreter version number does not match. The model version must be between 3 and 7 but the model version is 8 ()

Can you please give me some tips or direction how to fix the error to be able launch the object detection app.