zjukg / NeuralKG

[Tool] For Knowledge Graph Representation Learning
http://neuralkg.zjukg.org/
Apache License 2.0
348 stars 63 forks source link

使用demo_kg训练问题 #11

Closed swo026 closed 2 years ago

swo026 commented 2 years ago

将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 commented 2 years ago

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