pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.28k stars 3.65k forks source link

KeyError: '/location/country/form_of_government' #7969

Open estuday opened 1 year ago

estuday commented 1 year ago

🐛 Describe the bug

hi i run the code in https://github.com/pyg-team/pytorch_geometric/blob/master/examples/rgcn_link_pred.py, it reported the error as follows(*** for mask path, please ignore):

Traceback (most recent call last):
  File "/*****/****/rgcn_link_pred.py", line 23, in <module>
    dataset = RelLinkPredDataset(path, 'FB15k-237')
  File "/******/miniconda3/envs/pykeendemo/lib/python3.10/site-packages/torch_geometric/datasets/rel_link_pred_dataset.py", line 54, in __init__
    super().__init__(root, transform, pre_transform)
  File "/*******/miniconda3/envs/pykeendemo/lib/python3.10/site-packages/torch_geometric/data/in_memory_dataset.py", line 57, in __init__
    super().__init__(root, transform, pre_transform, pre_filter, log)
  File "/********/miniconda3/envs/pykeendemo/lib/python3.10/site-packages/torch_geometric/data/dataset.py", line 97, in __init__
    self._process()
  File "/*******/miniconda3/envs/pykeendemo/lib/python3.10/site-packages/torch_geometric/data/dataset.py", line 230, in _process
    self.process()
  File "/******/miniconda3/envs/pykeendemo/lib/python3.10/site-packages/torch_geometric/datasets/rel_link_pred_dataset.py", line 98, in process
    rel = [relations_dict[row[1]] for row in lines]
  File "/********/miniconda3/envs/pykeendemo/lib/python3.10/site-packages/torch_geometric/datasets/rel_link_pred_dataset.py", line 98, in <listcomp>
    rel = [relations_dict[row[1]] for row in lines]
KeyError: '/location/country/form_of_government'

Environment

rusty1s commented 1 year ago

Mh, this works for me. Wondering what might cause this. Can you remove the {root_dir}/raw directory (where you store the dataset) and try again? There might have been an issue with the downloaded files.