Closed ch1nlu closed 3 years ago
Issue fixed. We change the pytorch dependencies version in build.gradle
to match the one in HelloWorldApp
and it worked!
// implementation 'org.pytorch:pytorch_android:1.6.0-SNAPSHOT'
// implementation 'org.pytorch:pytorch_android_torchvision:1.6.0-SNAPSHOT'
implementation 'org.pytorch:pytorch_android:1.8.0'
implementation 'org.pytorch:pytorch_android_torchvision:1.8.0'
Hello, I came into this issue when I was trying to test the Image Classification in PytorchDemo with my own model
mobilenet.pt
, which is a binary classification model based on mobilenet_v2.I altered the original code to accomondate my demand: in
VisionListActivity.java
:I also altered
TOP_K=2
inImageClassificationActivity.java
.However, when I run Image Classification module, I got the following error message:
I had a hard time to debug the error message above.
It worked fine when I use the original
mobilenet_v2.pt
, so I've suspected the problem is caused by my own model. But turns out that my own modelmobilenet.pt
also works well when I plug it intoHelloWorldApp
project.Could you kindly help me?