我试图在我的intel w/ igpu上加载face_recognition,在安装和重新安装dlib后我无法使其运行,这是我的代码
import face_recognition
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-1-ca17cc6b8bdb> in <module>
----> 1 import face_recognition
~/anaconda3/envs/tfs_cpu/lib/python3.7/site-packages/face_recognition/__init__.py in <module>
5 __version__ = '1.2.3'
6
----> 7 from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
~/anaconda3/envs/tfs_cpu/lib/python3.7/site-packages/face_recognition/api.py in <module>
24
25 cnn_face_detection_model = face_recognition_models.cnn_face_detector_model_location()
---> 26 cnn_face_detector = dlib.cnn_face_detection_model_v1(cnn_face_detection_model)
27
28 face_recognition_model = face_recognition_models.face_recognition_model_location()
RuntimeError: Error while calling cudaGetDevice(&the_device_id) in file /tmp/pip-install-x2i2y7s0/dlib/dlib/cuda/gpu_data.cpp:201. code: 100, reason: no CUDA-capable device is detected
我已经像这样卸载了两个库
pip3 uninstall dlib
pip3 uninstall face_recognition
pip uninstall dlib
pip uninstall face_recognition
然后我像这样安装它们
pip3 install -v --install-option="--no" --install-option="DLIB_USE_CUDA" dlib
pip3 install face_recognition
但是图书馆只是弹出同样的错误,任何解决这个问题的建议都会很棒!
感谢您的阅读
colab中同样的问题,切换到任何GPU都可以解决问题,似乎人脸识别只有在存在GPU的情况下才能工作。