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

GAT runtime error #29

Closed
salmon1802 opened this issue May 25, 2024 · 2 comments
Closed

GAT runtime error #29

salmon1802 opened this issue May 25, 2024 · 2 comments

Comments

@salmon1802
Copy link

salmon1802 commented May 25, 2024

Thank you very much for your meaningful work! However, when I change the GCN to GAT in the config file, the following error is reported, I made attempts but still did not run successfully.

Below is my error log:

Processing...
Done!
seed for seed_everything(): 2024
2024-05-25 23:48:45,472 - Loaded dataset: ABIDE
0%| | 0/26 [00:00<?, ?it/s]edge_index shape: torch.Size([2, 1280000])
x shape: torch.Size([6400, 200])
Maximum index in edge_index: 6399
edge_attr: torch.Size([1280000])
0%| | 0/26 [00:00<?, ?it/s]
Traceback (most recent call last):
File "D:/GraduateStudent/code/BrainGB-master/examples/example_main.py", line 152, in
main(parser.parse_args())
File "D:/GraduateStudent/code/BrainGB-master/examples/example_main.py", line 78, in main
test_micro, test_auc, test_macro = train_and_evaluate(model, train_loader, test_loader,
File "D:\GraduateStudent\code\BrainGB-master\examples\train_and_evaluate.py", line 26, in train_and_evaluate
out = model(data)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "D:\GraduateStudent\code\BrainGB-master\src\models\brainnn.py", line 18, in forward
g = self.gnn(x, edge_index, edge_attr, batch)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "D:\GraduateStudent\code\BrainGB-master\src\models\gat.py", line 147, in forward
z = conv(z, edge_index, edge_attr)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\28334\AppData\Local\Temp\torch_geometric.nn.sequential_f0afbb_syfjdr4d.py", line 23, in forward
x = self.module_0(x, edge_index, edge_attr)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch_geometric\nn\conv\gat_conv.py", line 341, in forward
out = self.propagate(edge_index, x=x, alpha=alpha, size=size)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch_geometric\nn\conv\message_passing.py", line 538, in propagate
coll_dict = self._collect(self._user_args, edge_index,
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch_geometric\nn\conv\message_passing.py", line 399, in _collect
self._set_size(size, dim, data)
File "D:\zj\miniconda\envs\Dual-HINet\lib\site-packages\torch_geometric\nn\conv\message_passing.py", line 298, in _set_size
raise ValueError(
ValueError: Encountered tensor with size 1280000 in dimension 0, but expected size 6400.

Process finished with exit code 1

@Gemaxis
Copy link

Gemaxis commented Jun 12, 2024

It's due to your environment not matching the version. I faced the same problem, and I changed my Torch version to fix it.
Btw, if you are using Windows, you can select torch=1.8.1+cu102 with the corresponding torch_geometric version.

@salmon1802
Copy link
Author

Thanks for the reply @Gemaxis , I've run it successfully after changing the version as you said : )

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

2 participants