d-ailin/GDN

RuntimeError: The expanded size of the tensor (1) must match the existing size (69120) at non-singleton dimension 1. Target sizes: [69120, 1, 64]. Tensor sizes: [1, 69120, 1]

imilong opened this issue · 4 comments

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 "/home/pete/PycharmProjects/GDN-main/train.py", line 69, in train
out = model(x, edge_index).float().to(device)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(args, **kwargs)
File "/home/pete/PycharmProjects/GDN-main/models/GDN.py", line 166, in forward
gcn_out = self.gnn_layers[i](x, batch_gated_edge_index, node_num=node_num
batch_num, embedding=all_embeddings)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/pete/PycharmProjects/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 "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/pete/PycharmProjects/GDN-main/models/graph_layer.py", line 65, in forward
out = self.propagate(edge_index, x=x, embedding=embedding, edges=edge_index,
File "/tmp/models.graph_layer_GraphLayer_propagate_ly_wvtvt.py", line 258, in propagate
out = self.aggregate(
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/nn/conv/message_passing.py", line 625, in aggregate
return self.aggr_module(inputs, index, ptr=ptr, dim_size=dim_size,
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/experimental.py", line 117, in wrapper
return func(*args, **kwargs)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/nn/aggr/base.py", line 136, in call
raise e
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/nn/aggr/base.py", line 128, in call
return super().call(x, index=index, ptr=ptr, dim_size=dim_size,
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/nn/aggr/basic.py", line 22, in forward
return self.reduce(x, index, ptr, dim_size, dim, reduce='sum')
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/nn/aggr/base.py", line 182, in reduce
return scatter(x, index, dim, dim_size, reduce)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/utils/_scatter.py", line 74, in scatter
index = broadcast(index, src, dim)
File "/home/pete/anaconda3/envs/mamba/lib/python3.8/site-packages/torch_geometric/utils/_scatter.py", line 179, in broadcast
return src.view(size).expand_as(ref)
RuntimeError: The expanded size of the tensor (1) must match the existing size (69120) at non-singleton dimension 1. Target sizes: [69120, 1, 64]. Tensor sizes: [1, 69120, 1]

我跑啥数据集都是这个error,该怎么解决?

你好,我也是这个错误,请问你解决了吗

Hi, this might be related to the mismatched package #6.

Hi, this might be related to the mismatched package #6.

Thanks!

Hi, this might be related to the mismatched package #6.

Thanks!

你好,请问你现在能跑通吗