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

使用demo_kg训练问题 #11

Closed
swo026 opened this issue Aug 30, 2022 · 1 comment
Closed

使用demo_kg训练问题 #11

swo026 opened this issue Aug 30, 2022 · 1 comment

Comments

@swo026
Copy link

swo026 commented Aug 30, 2022

将ConvE_*.yaml改成demo_kg数据集之后数据集似乎不能正确加载,会出现警告
D:\Users\lenovo\anaconda3\envs\deepKE\lib\site-packages\pytorch_lightning\utilities\data.py:122: UserWarning: DataLoader returned 0 length. Please make sure this was your intention.
rank_zero_warn(
D:\Users\lenovo\anaconda3\envs\deepKE\lib\site-packages\pytorch_lightning\utilities\data.py:153: UserWarning: Total length of CombinedLoader across ranks is zero. Please make sure this was your intention.
rank_zero_warn(
导致模型不能训练,也没有参数保存下来,最终报错
Traceback (most recent call last):
File ".\main.py", line 112, in
main()
File ".\main.py", line 107, in main
lit_model.load_state_dict(torch.load(path)["state_dict"])
File "D:\Users\lenovo\anaconda3\envs\deepKE\lib\site-packages\torch\serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "D:\Users\lenovo\anaconda3\envs\deepKE\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "D:\Users\lenovo\anaconda3\envs\deepKE\lib\site-packages\torch\serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: ''

@Modberge
Copy link
Collaborator

你好,demo_kg是一个非常小的数据集,仅包含15个实体和7个关系,如果将train_bs和eval_bs参数设置过大,会发生越界错误。据我所知,ConvE_*.yaml中设置的参数不适合训练demo_kg数据集,请尝试更改train_bs或eval_bs参数,

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

2 participants