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

Error occurs when starting training #6

Closed
zhujun001 opened this issue Aug 23, 2021 · 4 comments
Closed

Error occurs when starting training #6

zhujun001 opened this issue Aug 23, 2021 · 4 comments

Comments

@zhujun001
Copy link

Hi,
I encounter such error when just running command "bash run.sh 0 msl". Any idea about it? Thanks!

Traceback (most recent call last):
File "main.py", line 256, in
main.run()
File "main.py", line 108, in run
self.train_log = train(self.model, model_save_path,
File "/media/home/jzhu/projects/GDN-main/train.py", line 70, in train
out = model(x, edge_index).float().to(device)
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(input, **kwargs)
File "/media/home/jzhu/projects/GDN-main/models/GDN.py", line 167, in forward
gcn_out = self.gnn_layers[i](x, batch_gated_edge_index, node_num=node_num
batch_num, embedding=all_embeddings)
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/media/home/jzhu/projects/GDN-main/models/GDN.py", line 73, in forward
out, (new_edge_index, att_weight) = self.gnn(x, edge_index, embedding, return_attention_weights=True)
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/media/home/jzhu/projects/GDN-main/models/graph_layer.py", line 72, in forward
out = self.propagate(edge_index, x=x, embedding=embedding, edges=edge_index,
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch_geometric/nn/conv/message_passing.py", line 253, in propagate
out = self.aggregate(out, **aggr_kwargs)
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch_geometric/nn/conv/message_passing.py", line 287, in aggregate
return scatter(inputs, index, dim=self.node_dim, dim_size=dim_size,
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch_scatter/scatter.py", line 153, in scatter
return scatter_sum(src, index, dim, out, dim_size)
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch_scatter/scatter.py", line 11, in scatter_sum
index = broadcast(index, src, dim)
File "/media/home/jzhu/anaconda3/envs/py3/lib/python3.8/site-packages/torch_scatter/utils.py", line 13, in broadcast
src = src.expand_as(other)
RuntimeError: The expanded size of the tensor (1) must match the existing size (4320) at non-singleton dimension 1. Target sizes: [4320, 1, 64]. Tensor sizes: [1, 4320, 1]

@QianFanCe
Copy link

I meet the problem too, try this:
pip install torch-geometric==1.5.0

@zhujun001
Copy link
Author

I meet the problem too, try this:
pip install torch-geometric==1.5.0

Thanks!

@lovechang1986
Copy link

I meet the same issue.
Would you like to update the GDN based on the latest version of torch_geometric?

@fede-bello
Copy link

Could anyone fix this problem with a more recent version of pytorch_geometric? 1.5 is quite deprecated nowadays

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

4 participants