Skip to content

add scikit-learn recipe and dependencies #2539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mzakharo
Copy link
Contributor

Adding support for one of the most popular machine-learning frameworks in python.

@Neizvestnyj
Copy link
Contributor

Cool, but I get this error:

/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/joblib/_multiprocessing_helpers.py:45: UserWarning: [Errno 38] Function not implemented.  joblib will operate in serial mode
03-16 22:12:19.140 21637 22044 I python  :  Traceback (most recent call last):
03-16 22:12:19.140 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/multiprocessing/synchronize.py", line 28, in <module>
03-16 22:12:19.140 21637 22044 I python  :  ImportError: cannot import name 'sem_unlink' from '_multiprocessing' (/data/user/0/org.kivy.<APP>/files/app/_python_bundle/modules/_multiprocessing.cpython-38.so)
03-16 22:12:19.140 21637 22044 I python  :  
03-16 22:12:19.141 21637 22044 I python  :  During handling of the above exception, another exception occurred:
03-16 22:12:19.141 21637 22044 I python  :  
03-16 22:12:19.141 21637 22044 I python  :  Traceback (most recent call last):
03-16 22:12:19.141 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/app/modes/skin/no_face_skin_detection.py", line 2, in <module>
03-16 22:12:19.141 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/app/modes/skin/face_detection.py", line 3, in <module>
03-16 22:12:19.141 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/sklearn/__init__.py", line 80, in <module>
03-16 22:12:19.141 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/sklearn/base.py", line 21, in <module>
03-16 22:12:19.141 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/sklearn/utils/__init__.py", line 23, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/sklearn/utils/class_weight.py", line 7, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/sklearn/utils/validation.py", line 21, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/joblib/__init__.py", line 120, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/joblib/parallel.py", line 30, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/joblib/externals/loky/__init__.py", line 11, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/<APP>/armeabi-v7a/joblib/externals/loky/backend/__init__.py", line 13, in <module>
03-16 22:12:19.142 21637 22044 I python  :    File "<frozen zipimport>", line 259, in load_module
03-16 22:12:19.142 21637 22044 I python  :    File "/home/neizvestnyj/<APP>/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/multiprocessing/synchronize.py", line 30, in <module>
03-16 22:12:19.142 21637 22044 I python  :  ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

@mzakharo
Copy link
Contributor Author

joblib/multiprocessing functionality of sklearn does not work due to the sem_open issue.

@nmilosev
Copy link

nmilosev commented Jun 4, 2022

I tested this and it seems to work fine! Although, joblib still throws the warning that it will run in serial mode. Perhaps sklearn version can be bumped also to 1.x?

Thank you @mzakharo

@mzakharo
Copy link
Contributor Author

mzakharo commented Jun 4, 2022 via email

@misl6
Copy link
Member

misl6 commented Jun 5, 2022

Move to ndk 23 in develop branch breaks fortran build. Not sure how to overvome this.

Yeah, unfortunately even if I tried, FORTRAN support on Android with the new build tools (which does not have GCC support) is hard. See: #2550 (comment)

Maybe we can talk about an "alternative" way to support it on python-for-android? (Like keeping support for NDK 19c even if not marked as "recommended")

Edit: Feel free to ping me for a chat on Discord #dev channel

@mzakharo
Copy link
Contributor Author

mzakharo commented Jun 6, 2022

#2615 for scipy/lapack hopefully overcomes the limitations of the latest NDK releases

@mzakharo mzakharo requested a review from misl6 June 24, 2022 14:55
@Huge
Copy link

Huge commented Apr 22, 2024

#2615 for scipy/lapack hopefully overcomes the limitations of the latest NDK

It got merged, did anyone test this PR with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants