python-for-android icon indicating copy to clipboard operation
python-for-android copied to clipboard

torch recipe feature request

Open izipris opened this issue 11 months ago • 1 comments

Hi,

I have a python Kivy app which is using torch package. After I compiled it using buildozer android debug, installed the APK and tried to run the application, I received the following error: OSError: dlopen failed: library "/data/user/0/com.example.app/files/app/_python_bundle/site-packages/torch/lib/libtorch_global_deps.so" not found . During my search online I encountered issue #1538 in kivy/buildozer, where @misl6 mentioned that torch is not a plain-python package, so it will need a recipe in order to be cross-compiled.

Is it possible to add this recipe? IMHO it will be very valuable, especially these days, when we see a lot of ML applications.

Thanks, Idan.

izipris avatar Jan 21 '25 20:01 izipris

I don't know if this is still an issue for you but I'm running a pytorch model with kivy on android. I converted it to .onnx and wrote this wrapper of the native android api using pyjnius: https://github.com/aicelen/Onnx-Kivy-Android. It works really well and support is also great (I'm running a vision transformer).

aicelen avatar Oct 19 '25 08:10 aicelen