下载散文模板,在工程目录下建文件夹model/sanwen/将文件config.json、pytorch_model.bin、vocab.txt放入,修改源码:
parser.add_argument(
"--model_path",
default="model/sanwen/",
type=str,
required=False,
help="模型路径",
)
执行后报错:(已经确定文件目录存在)
Traceback (most recent call last):
File "./generate.py", line 233, in
main()
File "./generate.py", line 206, in main
for key, value in torch.load(args.model_path, map_location="cpu")[
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line
579, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line
230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line
211, in init
super(_open_file, self).init(open(name, mode))
PermissionError: [Errno 13] Permission denied: 'model/sanwen/'
下载散文模板,在工程目录下建文件夹model/sanwen/将文件config.json、pytorch_model.bin、vocab.txt放入,修改源码: parser.add_argument( "--model_path", default="model/sanwen/", type=str, required=False, help="模型路径", ) 执行后报错:(已经确定文件目录存在) Traceback (most recent call last): File "./generate.py", line 233, in
main()
File "./generate.py", line 206, in main
for key, value in torch.load(args.model_path, map_location="cpu")[
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line
579, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line
230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line
211, in init
super(_open_file, self).init(open(name, mode))
PermissionError: [Errno 13] Permission denied: 'model/sanwen/'