JD-AI-Research-Silicon-Valley / SACN

End-to-end Structure-Aware Convolutional Networks for Knowledge Base Completion
MIT License
112 stars 30 forks source link

error code of SACN model #12

Closed Gosline01 closed 4 years ago

Gosline01 commented 4 years ago

Sorry to bother you, when I run your code of SACN model, it pull an error just like below, I tried to solve it by my self, however ,it still pull error, I hope you can help me File "main.py", line 250, in main() File "main.py", line 229, in main pred = model.forward(e1, rel, X.cuda(), adjacencies) File "/home/hg-1/Gosline_data/GCN/SACN-master/models.py", line 269, in forward x = self.gc1(emb_initial, A) File "/home/hg-1/anaconda3/envs/liudipytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "/home/hg-1/Gosline_data/GCN/SACN-master/models.py", line 167, in forward A = torch.sparse_coo_tensor(adj[0], alp, torch.Size([adj[2], adj[2]]), requires_grad=True) RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #1 'indices' a beginner of AI learning