Skip to content
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

ModuleNotFoundError: No module named 'sklearn.neighbors.classification' #76

Open
YePG opened this issue Jan 13, 2022 · 8 comments
Open

Comments

@YePG
Copy link

YePG commented Jan 13, 2022

how to solve it?

@siabingtao
Copy link

I am facing the same issue too. Is anyone able to help? This happens when I am trying to run the s5_test.py script.

@siabingtao
Copy link

Hi, I managed to rectify it. I think that this happened because the installed version of scikit-learn was a newer one.

I first uninstalled scikit-learn:
pip uninstall scikit-learn
I then proceeded to install scikit-learn version 0.20.4:
pip install scikit-learn==0.20.4

@steve-95
Copy link

steve-95 commented Mar 1, 2022

I have try pip install scikit-learn==0.20.4, and solved my problem ,thanks @siabingtao

@muyou111
Copy link

to install scikit-learn version 0.21.3 is OK

@TYang92677626
Copy link

I'm using scikit-learn1.4 version
Without downgrading the version, change sklearn.neighbors.classification in the trained_classifier.pickle of the training model to sklearn.neighbors._classification
Because scikit-learn has been underlined since version 0.22.x.
There are also several underlined ones:
Original: sklearn.tree.tree
Change to: sklearn.tree._classes (needs to be changed to classes here)
Original: sklearn.ensemble.forest
Change to: sklearn.ensemble._forest
Original: sklearn.preprocessing.label
Change to: sklearn.preprocessing._label
etc.

@steve-95
Copy link

steve-95 commented Jan 29, 2024 via email

@hieu2k2boss
Copy link

Training_classifier.pickle

how to open file :"Training_classifier.pickle". I got this error when running "s5_test.py" .
Error:

Traceback (most recent call last):
File "/content/drive/MyDrive/Realtime-Action-Recognition-master/src/s5_test.py", line 357, in
dict_id2label = multiperson_classifier.classify(
File "/content/drive/MyDrive/Realtime-Action-Recognition-master/src/s5_test.py", line 219, in classify
self.dict_id2clf[id] = self._create_classifier(id)
File "/content/drive/MyDrive/Realtime-Action-Recognition-master/src/s5_test.py", line 201, in
self._create_classifier = lambda human_id: ClassifierOnlineTest(
File "/content/drive/MyDrive/Realtime-Action-Recognition-master/src/../utils/lib_classifier.py", line 135, in init
self.model = pickle.load(f)
_pickle.UnpicklingError: invalid load key, '\xef'.

@xionzhen
Copy link

xionzhen commented Mar 9, 2024

hello,I met a question about how to open file :"Training_classifier.pickle" and change the pickle.If I just open it in a directly way and change it to sklearn.neighbors._classification,will get the error of _pickle.UnpicklingError: invalid load key, '\xef'.

I'm using scikit-learn1.4 version Without downgrading the version, change sklearn.neighbors.classification in the trained_classifier.pickle of the training model to sklearn.neighbors._classification Because scikit-learn has been underlined since version 0.22.x. There are also several underlined ones: Original: sklearn.tree.tree Change to: sklearn.tree._classes (needs to be changed to classes here) Original: sklearn.ensemble.forest Change to: sklearn.ensemble._forest Original: sklearn.preprocessing.label Change to: sklearn.preprocessing._label etc.

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

No branches or pull requests

7 participants