Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Parent directory models does not exist. #35

Open
Mariyaaaaaaaaaa opened this issue Sep 12, 2023 · 1 comment
Open

RuntimeError: Parent directory models does not exist. #35

Mariyaaaaaaaaaa opened this issue Sep 12, 2023 · 1 comment

Comments

@Mariyaaaaaaaaaa
Copy link

Traceback (most recent call last):
File "D:\lunwen2\githubprogram--gnn\graphsage\graphSAGE-pytorch-master\main.py", line 76, in
args.max_vali_f1 = evaluate(dataCenter, ds, graphSage, classification, device, args.max_vali_f1, args.name, epoch)
File "D:\lunwen2\githubprogram--gnn\graphsage\graphSAGE-pytorch-master\src\utils.py", line 52, in evaluate
torch.save(models, 'models/model_best_{}ep{}{:.4f}.torch'.format(name, cur_epoch, test_f1))
File "D:\lunwen2\githubprogram--gnn\graphsage\graphSAGE-pytorch-master\venv\lib\site-packages\torch\serialization.py", line 440, in save
with _open_zipfile_writer(f) as opened_zipfile:
File "D:\lunwen2\githubprogram--gnn\graphsage\graphSAGE-pytorch-master\venv\lib\site-packages\torch\serialization.py", line 315, in _open_zipfile_writer
return container(name_or_buffer)
File "D:\lunwen2\githubprogram--gnn\graphsage\graphSAGE-pytorch-master\venv\lib\site-packages\torch\serialization.py", line 288, in init
super().init(torch._C.PyTorchFileWriter(str(name)))
RuntimeError: Parent directory models does not exist.

@Mariyaaaaaaaaaa
Copy link
Author

定位到这行代码torch.save(models, 'models/model_best_{}ep{}{:.4f}.torch'.format(name, cur_epoch, test_f1)),可以发现代码本是打算将模型保存在models文件夹下,但是下载下来的项目并没有该文件夹。有两种解决方案,第一种,在graphSAGE-pytorch-master下创建一个models的文件夹;第二种,将models换成其他已有的文件夹,如src。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant