-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Face clustering runs Out of memory #721
Comments
@blackmore190 I had the same problem. I looked at the code that the error message pointed to, it seems the problem is that the program needs to allocate memories for all possible pairs of images (unless it is too different based on the Euclidean distance) in order to run the Chinese Whisper algorithm. This doesn't work for large number of images. Without a change on how the algorithm works, the only thing we can do is to lower the clustering threshold (in the admin setting panel). I have 118k images, 54k faces and need to low the threshold to 0.32 in order to complete the clustering in a machine with 11G RAM. The result is still pretty good. I do think the current implementation of algorithm is not scalable to very large number of images. So I hope a new algorithm can be used to address the issue. |
Hi both, I was focused on improve the speed of clustering, but in the specific case of what you describe in the last comment it should help you since the comparison is also done in batches, but in particular all the faces must still be loaded into memory, which consumes a lot of resources. |
@matiasdelellis Thank you for this change. It worked well for me. With over 55K faces, it would not complete with 2G maximum memory, but is now reliable and takes less time to finish than it took to fail without this change. Some tuning of the batch size seemed to help:
The main benefit was a noticeable improvement in the quality of clustering as the batch size is larger. |
I echo @stevehuk . 20k was the sweet spot for me as well with ~100k faces per user. |
I have a lot of faces, running nextcloud aio with external model. If Run the Background Jon via occ it Crashes with this Message:
'''61580 faces found for clustering
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to al
locate 536870920 bytes) in /var/www/html/custom_apps/facerecognition/lib/Backgro
undJob/Tasks/CreateClustersTask.php on line 330'''
Is it possible to Split the clustering into smaller packages wich could be handled by the allowed memory size?
Thanks!
The text was updated successfully, but these errors were encountered: