问题遇到的现象和发生背景
在使用pycharm加载下载好的预训练模型时发生错误,找了好多地方都没找到答案
问题相关代码,请勿粘贴截图
parser.add_argument('--pretrain_path', default='EfficientFace_Trained_on_AffectNet8.pth', type=str
,help='Pretrained model (.pth), efficientface')
运行结果及报错内容
Traceback (most recent call last):
File "D:/graduate/practices/multimodal-emotion-recognition-main/main.py", line 49, in
model, parameters = generate_model(opt)
File "D:\graduate\practices\multimodal-emotion-recognition-main\model.py", line 14, in generate_model
model = multimodalcnn.MultiModalCNN(opt.n_classes, fusion=opt.fusion, seq_length=opt.sample_duration,
File "D:\graduate\practices\multimodal-emotion-recognition-main\models\multimodalcnn.py", line 169, in init
init_feature_extractor(self.visual_model, pretr_ef)
File "D:\graduate\practices\multimodal-emotion-recognition-main\models\multimodalcnn.py", line 105, in init_feature_extractor
checkpoint = torch.load(path, map_location=torch.device('cpu'))
File "D:\software_install\Anaconda3\Anaconda3_install\envs\pytorchGPU\lib\site-packages\torch\serialization.py", line 699, in load
with _open_file_like(f, 'rb') as opened_file:
File "D:\software_install\Anaconda3\Anaconda3_install\envs\pytorchGPU\lib\site-packages\torch\serialization.py", line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File "D:\software_install\Anaconda3\Anaconda3_install\envs\pytorchGPU\lib\site-packages\torch\serialization.py", line 212, in init
super(_open_file, self).init(open(name, mode))
PermissionError: [Errno 13] Permission denied: 'EfficientFace_Trained_on_AffectNet8.pth'