You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]
#96
Open
imilong opened this issue
Apr 24, 2024
· 5 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_numbatch_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,该怎么解决?
The text was updated successfully, but these errors were encountered:
I also encountered the same error, may I ask what package does not match? Should I strictly limit the versions of the following package?
Python >= 3.6
cuda == 10.2
Pytorch = = 1.5.1
PyG: torch-geometric==1.5.0
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_numbatch_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,该怎么解决?
The text was updated successfully, but these errors were encountered: