Python DeepFace库-访问被拒绝,出现以下错误

Python DeepFace库-访问被拒绝,出现以下错误,python,deep-learning,Python,Deep Learning,我正在尝试使用DeepFace进行面部识别。我已安装库: pip install deepface from deepface import DeepFace happy_face = cv2.imread('happy.jpg') predictions=DeepFace.analyze(happy_face, actions = ['age', 'gender', 'race', 'emotion']) 但我得到了以下错误: facial_expression_model_weights

我正在尝试使用DeepFace进行面部识别。我已安装库:

pip install deepface

from deepface import DeepFace
happy_face = cv2.imread('happy.jpg')
predictions=DeepFace.analyze(happy_face, actions = ['age', 'gender', 'race', 'emotion'])
但我得到了以下错误:

facial_expression_model_weights.h5 will be downloaded...
Access denied with the following error:

    Too many users have viewed or downloaded this file recently. Please
    try accessing the file again later. If the file you are trying to
    access is particularly large or is shared with many people, it may
    take up to 24 hours to be able to view or download the file. If you
    still can't access a file after 24 hours, contact your domain
    administrator. 

You may still be able to access the file from the browser:

     https://drive.google.com/uc?id=13iUHHP3SlNg53qSuQZDdHDSDNdBP9nwy 

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-41-ecaf75345ffc> in <module>
----> 1 predictions=DeepFace.analyze(happy_face, actions = ['age', 'gender', 'race', 'emotion'])

C:\ProgramData\Anaconda3\lib\site-packages\deepface\DeepFace.py in analyze(img_path, actions, models, enforce_detection, detector_backend)
    323                         emotion_model = models['emotion']
    324                 else:
--> 325                         emotion_model = build_model('Emotion')
    326 
    327         if 'age' in actions:

C:\ProgramData\Anaconda3\lib\site-packages\deepface\DeepFace.py in build_model(model_name)
     43 
     44         if model:
---> 45                 model = model()
     46                 #print('Using {} model backend'.format(model_name))
     47                 return model

C:\ProgramData\Anaconda3\lib\site-packages\deepface\extendedmodels\Emotion.py in loadModel()
     51 
     52                 #unzip facial_expression_model_weights.zip
---> 53                 with zipfile.ZipFile(output, 'r') as zip_ref:
     54                         zip_ref.extractall(home+'/.deepface/weights/')
     55 

C:\ProgramData\Anaconda3\lib\zipfile.py in __init__(self, file, mode, compression, allowZip64, compresslevel)
   1202             while True:
   1203                 try:
-> 1204                     self.fp = io.open(file, filemode)
   1205                 except OSError:
   1206                     if filemode in modeDict:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\aasth/.deepface/weights/facial_expression_model_weights.zip'
将下载面部表情模型权重.h5。。。 访问被拒绝,出现以下错误: 最近查看或下载此文件的用户太多。请 请稍后再次尝试访问该文件。如果您正在尝试创建的文件 访问量特别大或与许多人共享,可能 最多需要24小时才能查看或下载文件。如果你 24小时后仍无法访问文件,请与您的域联系 管理员 您仍可以从浏览器访问该文件: https://drive.google.com/uc?id=13iUHHP3SlNg53qSuQZDdHDSDNdBP9nwy --------------------------------------------------------------------------- FileNotFoundError回溯(最近一次调用上次) 在里面 ---->1预测=深度脸。分析(快乐脸,行动=[‘年龄’、‘性别’、‘种族’、‘情感’) 分析中的C:\ProgramData\Anaconda3\lib\site packages\deepface\deepface.py(img\u路径、动作、模型、强制检测、检测器\u后端) 323情感模型=模型[“情感”] 324其他: -->325情感模型=构建模型(“情感”) 326 327如果行动中出现“年龄”: C:\ProgramData\Anaconda3\lib\site packages\deepface\deepface.py in build\u model(model\u name) 43 44如果型号: --->45型号=型号() 46#打印('使用{}模型后端'。格式(模型名称)) 47回报模型 loadModel()中的C:\ProgramData\Anaconda3\lib\site packages\deepface\extendedmodels\Emotion.py 51 52#解压缩面部表情_model_weights.zip --->53,zipfile.zipfile(输出'r')作为zip_参考: 54 zip_ref.extractall(主+'/.deepface/weights/')) 55 C:\ProgramData\Anaconda3\lib\zipfile.py in_uuuuinit_uuuuu(self、file、mode、compression、allowZip64、compresslevel) 1202虽然正确: 1203尝试: ->1204 self.fp=io.open(文件、文件模式) 1205除操作错误外: 1206如果文件模式为modeDict: FileNotFoundError:[Errno 2]没有这样的文件或目录:“C:\\Users\\aassh/.deepface/weights/face\u expression\u model\u weights.zip”
我试图搜索此错误,但找不到任何相关帖子。我还尝试在GoogleColab中运行相同的代码,但收到了相同的错误。这是图书馆的问题还是我遗漏了什么?

Google Drive中有预先训练的权重,似乎超出了限制。但是,您仍然可以从控制台日志中指定的链接手动下载预先训练的重量文件

网址:

然后,您应该将预先训练好的权重复制到HOME_文件夹/.deepface/weights文件夹,而您的HOME_文件夹如下所示。然后,deepface将不再下载预先训练的重量。顺便说一句,如果驱动器url下载了一个zip,那么你应该在这里解压它

from pathlib import Path
home = str(Path.home())
print("HOME_FOLDER is ",home)