pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.28k stars 3.65k forks source link

infomax error #24

Closed mdaniluk closed 6 years ago

mdaniluk commented 6 years ago

Hi, When I run infomax.py example I have the following error:

Train deep graph infomax.
Traceback (most recent call last):
  File "infomax.py", line 91, in <module>
    loss = train_infomax(epoch)
  File "infomax.py", line 83, in train_infomax
    loss = infomax(data.x, data.edge_index)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "infomax.py", line 56, in forward
    positive = self.encoder(x, edge_index, corrupt=False)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "infomax.py", line 28, in forward
    x = self.conv(x, edge_index)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch_geometric/nn/conv/gcn_conv.py", line 44, in forward
    out = self.prop(out, edge_index, edge_attr)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch_geometric/nn/prop/gcn_prop.py", line 30, in forward
    out = spmm(edge_index, edge_attr, x, num_nodes)
  File "build/bdist.linux-x86_64/egg/torch_sparse/spmm.py", line 17, in spmm
AttributeError: 'int' object has no attribute 'dim'
rusty1s commented 6 years ago

Hi,

I think this was a bug in an old torch-geometric version. I will update the package on pip soon. So far, you need to install from source. Sorry!

mdaniluk commented 6 years ago

Thanks for the quick response. It works.

rusty1s commented 6 years ago

Fixed in v0.3.1 on pypi.