pytorch / android-demo-app

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

Pytorch lite 1.12.2 issue on Android #297

Open yuxiaohui78 opened 1 year ago

yuxiaohui78 commented 1 year ago

For the example, https://github.com/pytorch/android-demo-app/tree/master/HelloWorldApp

When I updated the dependencies in the build.gradle from 1.9.0 to 1.12.2. The output of the model is wrong.

replace: implementation 'org.pytorch:pytorch_android_lite:1.9.0' implementation 'org.pytorch:pytorch_android_torchvision:1.9.0' with: implementation 'org.pytorch:pytorch_android_lite:1.12.2' implementation 'org.pytorch:pytorch_android_torchvision:1.12.2'

The correct result is MAX index=270, value=15.278462, "white wolf, Arctic wolf, Canis lupus tundrarum",

The wrong result with version 1.12.2 is MAX index=60, value=5.9510016, "night snake, Hypsiglena torquata",

sleepingsaint commented 1 year ago

I am using the gradle version 1.13.1 and I am also facing the same issue. Did you manage to resolve it?