Davicjc / Face-Safety

Este é um programa Python que utiliza a biblioteca "face recognition" para detectar e reconhecer rostos em imagens capturadas pela câmera. Ele possui recursos para adicionar e excluir registros de pessoas, além de um modo scanner que exibe o nome da pessoa ao entrar na frente da câmera. É útil para fins de segurança e controle de acesso.
11 stars 2 forks source link

cnn_face_detector = dlib.cnn_face_detection_model_v1(cnn_face_detection_model) RuntimeError: Error while calling cudaGetDevice(&the_device_id) in file /tmp/pip-install-1n4zswvd/dlib/dlib/cuda/gpu_data.cpp:204. code: 999, reason: unknown error #1

Open Rafhael369 opened 1 year ago

Rafhael369 commented 1 year ago

Would you help me?

I created a python development environment, installed opencv-python and face_recognition.

But when running the main code on linux, it returns this error:

(env) rafhael@rafhael-Alienware-m15-R6:~/Projetos/SMA/mi-sma-testes/face_rec$ python main.py 
Traceback (most recent call last):
  File "main.py", line 24, in <module>
    import face_recognition
  File "/home/rafhael/Projetos/SMA/mi-sma-testes/face_rec/env/lib/python3.8/site-packages/face_recognition/__init__.py", line 7, in <module>
    from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
  File "/home/rafhael/Projetos/SMA/mi-sma-testes/face_rec/env/lib/python3.8/site-packages/face_recognition/api.py", line 26, in <module>
    cnn_face_detector = dlib.cnn_face_detection_model_v1(cnn_face_detection_model)
RuntimeError: Error while calling cudaGetDevice(&the_device_id) in file /tmp/pip-install-1n4zswvd/dlib/dlib/cuda/gpu_data.cpp:204. code: 999, reason: unknown error
Davicjc commented 1 year ago

Hello Rafael, how are you? In Linux, the installation process is different from Windows. I will provide you with the page that explains how to install the dependencies for face recognition on Linux. Feel free to reach out to me at any time. 😊

https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf

Try following these steps and see if it resolves the issue. This problem is related to the program attempting to call CUDA and not finding it. Please let me know if you have any further questions.