ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.41k stars 13.49k forks source link

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

Closed DirkWuerdemann closed 3 years ago

DirkWuerdemann commented 3 years ago

Description

The pickle.load does not work. It gives the error message that their is No module named 'sklearn.neighbors.classification'

What I Did

I am using the example code

nadsur commented 3 years ago

does your problem solved?

diamondbarcode commented 3 years ago

you may try install scikit-learn

https://scikit-learn.org/stable/install.html

DirkWuerdemann commented 3 years ago

hi guys, thx for the hint. In the meantime my problem is solved. After a complete retaining it works. thx again Dirk

BenjaminArmijo3 commented 3 years ago

how do you solve it

hi guys, thx for the hint. In the meantime my problem is solved. After a complete retaining it works. thx again Dirk

DirkWuerdemann commented 3 years ago

Hi Benjamin, i have deletet the knn file and done a new training run. Than it works. Dirk

mimocha commented 3 years ago

sklearn.neighbors.classification was renamed to sklearn.neighbors._classification in version 0.22.X
Downgrade to scikit-learn version <= 0.21.3 to fix this problem


A little late to the party here, but I am having a similar problem, so I'll leave this for posterity purposes.

I'm trying to load an older Scikit-Learn KNN classifier model with pickle, but it's throwing the error: No module named 'sklearn.neighbors.classification', despite the fact that I have the latest version of scikit-learn installed and imported.

Since I am working with older code, I suspected this to be a version compatibility problem. So I did a little digging, and apparently scikit-learn changed the name of their file /sklearn/neighbors/classification.py to /sklearn/neighbors/_classification.py in version 0.22.X (See version 0.21.X in comparison)

So I downgraded my scikit-learn installation to 0.21.3, which successfully fixed the problem.

nomaad42 commented 3 years ago

sklearn.neighbors.classification was renamed to sklearn.neighbors._classification in version 0.22.X Downgrade to scikit-learn version <= 0.21.3 to fix this problem

A little late to the party here, but I am having a similar problem, so I'll leave this for posterity purposes.

I'm trying to load an older Scikit-Learn KNN classifier model with pickle, but it's throwing the error: No module named 'sklearn.neighbors.classification', despite the fact that I have the latest version of scikit-learn installed and imported.

Since I am working with older code, I suspected this to be a version compatibility problem. So I did a little digging, and apparently scikit-learn changed the name of their file /sklearn/neighbors/classification.py to /sklearn/neighbors/_classification.py in version 0.22.X (See version 0.21.X in comparison)

So I downgraded my scikit-learn installation to 0.21.3, which successfully fixed the problem.

Thanks ! It worked

pipashu1 commented 1 year ago

Thx ! My problem is " No module named 'sklearn.neighbors._classification'" . It also worked .