Page 1 of 1

face_dlib.py error after upgrading to Fedora 40

Posted: Thu Jun 20, 2024 1:09 pm
by kenworth
I recently upgraded my server to Fedora 40 which also updated Python to 3.12 making it necessary to reinstall all of the packages necessary for ZMES to function. Everything is now working normally except for face recognition which throws the following error:

zmesdetect[1247004] ERR face_dlib.py:110 [Error loading KNN model: Can't get attribute 'EuclideanDistance' on <module 'sklearn.metrics._dist_metrics' from '/usr/local/lib64/python3.12/site-packages/sklearn/metrics/_dist_metrics.cpython-312-x86_64-linux-gnu.so'>]

I have done some research on this issue and it appears that versions of sklearn 1.3.0 and greater have changed the EuclideanDistance attribute names. The latest version of sklearn is 1.5.0 which is what I have installed. What I can't find is where this attribute is referenced in the code.

If anyone has seen this problem or has any suggestions please respond. Thanks!

Re: face_dlib.py error after upgrading to Fedora 40

Posted: Thu Jun 20, 2024 1:36 pm
by kenworth
I figured this out. The error was happening when face_dlib.py was trying to load the file /var/lib/zmeventnotification/known_faces/faces.dat into a KNN object. Since the structure of this object class changed in later versions of sklearn, I needed to rerun /var/lib/zmeventnotification/bin/zm_train_faces.py to update the structure of the faces.dat file.

This resolved the error.

Re: face_dlib.py error after upgrading to Fedora 40

Posted: Wed Jul 10, 2024 3:46 pm
by eckerc
That's good news!snake game Can I send private message for you, I have some problems that involves it and I hope to receive some advices from you!