Unable to open ..\shape_predictor_68_face_landmarks.dat

在跑程序的时候遇到报错:

Using TensorFlow backend.
Traceback (most recent call last):
  File "D:/lakuite/临时文件夹/python/code/MesoNet/example.py", line 3, in
    from MesoNet.pipeline import *
  File "D:\lakuite\临时文件夹\python\code\MesoNet\pipeline.py", line 12, in
    import face_recognition
  File "D:\lakuite\临时文件夹\python\code\venv1\lib\site-packages\face_recognition\__init__.py", line 7, in
    from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
  File "D:\lakuite\临时文件夹\python\code\venv1\lib\site-packages\face_recognition\api.py", line 17, in
    pose_predictor_68_point = dlib.shape_predictor(predictor_68_point_model)
RuntimeError: Unable to open D:\lakuite\临时文件夹\python\code\venv1\lib\site-packages\face_recognition_models\models\shape_predictor_68_face_landmarks.dat

怀疑是 face_recognition 的问题,之前直接在pycharm中下载的,参考[1]重新装了一下,好像face_recognition有前置要求需要dlib,参考[2]。然而重装后问题依然存在。

根据[3],怀疑是pycharm工作区的路径中存在中文,于是下意识的直接修改了文件下名字。结果因为路径更改原来的程序都运行不了了,参考[4],最后得以解决。

 

参考文档

[1] win10 Face_recognition教程

[2] dlib安装(windows10, python3.7)

[3] import face_recognition运行出错

[4] 更改工程名路径,导致pycharm找不到指定文件

你可能感兴趣的:(问题汇总)