android-demo-app
android-demo-app copied to clipboard
Try to use pytorch_android:1.10.0
Hello, from yolov5s, i created my own model and try to integrate it to "ObjectDetection" but I have the following error:
The model version must be between 3 and 5But the model version is 7 ()
I think that i use pytorch:1.10 on my computer (??)
So, i try to change the next two lines of "build:gradle:app" :
implementation 'org.pytorch:pytorch_android_lite:1.10.0' implementation 'org.pytorch:pytorch_android_torchvision:1.10.0'
But during the compilation of "ObjectDetection", i have the following error :
Duplicate class org.pytorch.BuildConfig found in modules jetified-pytorch_android-1.10.0-runtime (org.pytorch:pytorch_android:1.10.0) and jetified-pytorch_android_lite-1.10.0-runtime (org.pytorch:pytorch_android_lite:1.10.0)
What can i do to use my proper yolov5s model with ObjectDetection
Thanks for your help L'Atome
I think this is what you want :https://github.com/jeffxtang/android-demo-app/tree/pt1.10
Thanks for all
To make things easier here is the direct solution:
The pytorch guys changed torchvision to torchvision_lite from 1.9.0 to 1.10.0 which breaks the build when you just update the version number.
You need to replace the dependency
implementation 'org.pytorch:pytorch_android_torchvision:1.10.0'
with
implementation 'org.pytorch:pytorch_android_torchvision_lite:1.10.0'
(adding the _lite).
To make things easier here is the direct solution: The pytorch guys changed torchvision to torchvision_lite from 1.9.0 to 1.10.0 which breaks the build when you just update the version number. You need to replace the dependency
implementation 'org.pytorch:pytorch_android_torchvision:1.10.0'withimplementation 'org.pytorch:pytorch_android_torchvision_lite:1.10.0'(adding the _lite).
This worked for me, but classification results are coming wrong with ptl file generated from the script given along with HelloWorld app.