A problem when running R-GCN

Hi,
I use the code of relational GCN(pytorch version) to do link prediction(dgl/examples/pytorch/rgcn at master · dmlc/dgl · GitHub), but an error occured when i run the link.py.
My Pytorch version is 1.13.1, and DGL version is 1.0.2+cu116

I think maybe there are some problems with my version?
Could someone help me with the question?
Thanks a lot!

Traceback (most recent call last):
File “examples/pytorch/rgcn/link.py”, line 327, in
train(
File “examples/pytorch/rgcn/link.py”, line 260, in train
for epoch, batch_data in enumerate(dataloader): # single graph batch
File “D:\anaconda\lib\site-packages\torch\utils\data\dataloader.py”, line 628, in next
data = self._next_data()
File “D:\anaconda\lib\site-packages\torch\utils\data\dataloader.py”, line 671, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File “D:\anaconda\lib\site-packages\torch\utils\data_utils\fetch.py”, line 58, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “D:\anaconda\lib\site-packages\torch\utils\data_utils\fetch.py”, line 58, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File “examples/pytorch/rgcn/link.py”, line 77, in getitem
src, dst = self.g.find_edges(eids)
File “D:\anaconda\lib\site-packages\dgl\heterograph.py”, line 3327, in find_edges
eid = utils.prepare_tensor(self, eid, “eid”)
File “D:\anaconda\lib\site-packages\dgl\utils\checks.py”, line 36, in prepare_tensor
raise DGLError(
dgl._ffi.base.DGLError: Expect argument “eid” to have data type torch.int64. But got torch.int32.

It works with dgl 1.1.0+cu116 and pytorch 1.12.0+cu116, can you try install pytorch with the same cuda verison or if you just want to train on cpu, then install dgl without cuda version?

Thanks! I’ll have a try.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.