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

IndexError about result #37

Open
githublx1997 opened this issue May 11, 2021 · 3 comments
Open

IndexError about result #37

githublx1997 opened this issue May 11, 2021 · 3 comments

Comments

@githublx1997
Copy link

Traceback (most recent call last):
File "train_paper_field.py", line 242, in
node_rep = gnn.forward(node_feature.to(device), node_type.to(device), edge_time.to(device), edge_index.to(device), edge_type.to(device))
File "/home/liangxiao/pyHGT/OAG/pyHGT/model.py", line 79, in forward
meta_xs = gc(meta_xs, node_type, edge_index, edge_type, edge_time)
File "/home/liangxiao/anaconda3/envs/pyhgt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/liangxiao/pyHGT/OAG/pyHGT/conv.py", line 317, in forward
return self.base_conv(meta_xs, node_type, edge_index, edge_type, edge_time)
File "/home/liangxiao/anaconda3/envs/pyhgt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/liangxiao/pyHGT/OAG/pyHGT/conv.py", line 58, in forward
edge_type=edge_type, edge_time = edge_time)
File "/home/liangxiao/anaconda3/envs/pyhgt/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 234, in propagate
kwargs)
File "/home/liangxiao/anaconda3/envs/pyhgt/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 156, in collect
self.set_size(size, dim, data)
File "/home/liangxiao/anaconda3/envs/pyhgt/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 118, in set_size
size[dim] = src.size(self.node_dim)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got -2)

why do I have this error ? Is there anything wrong with my pyg version or anything else?(I use the new version)

@githublx1997
Copy link
Author

I have solved this problem by changing the pyg version to 1.4.3,it seems the _scatter had been overwritting after 1.4.3 version

@Juicechen95
Copy link

Juicechen95 commented May 20, 2021

I also met this problem. Unfortunately, I can not change pyg version to 1.4.3 for some reason. Is there any other idea to solve this problem? For example , how should I change the code to fit the higher pyg version?

@rainman503
Copy link

I have solved this problem by changing the pyg version to 1.4.3,it seems the _scatter had been overwritting after 1.4.3 version

Do you mean the version of pytorch-geometric?

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

3 participants