GIB icon indicating copy to clipboard operation
GIB copied to clipboard

Expand_as RuntimeError in torch_scatter

Open tjb-tech opened this issue 3 years ago • 4 comments
trafficstars

Hi, I am running your code. And I am inheritanting Messagepassing in pytorch_geometric to create my own graph conv, but I face the error below. To be exact, it occurs in function propagate, and I sent edge_index(shape: 2, edge_num) and x (shape: num_node, 128) into propagate. And I try my code on both linux and win. And they occurred the same problems. Note that I use the famous dataset Cora use the code dataset = Planetoid(path, 'Cora', transform=T.NormalizeFeatures())

Linux: J4U6NM5}) )(0RA2LZBQG8K

Win: L9~ GBZ1WKSA{{0S1W M08Q

My Environment: PyG version: 2.0.3 PyTorch version: 1.9.1 OS: Ubuntu x86_64 Python version: 3.8.12 CUDA/cuDNN version: 11.1 How you installed PyTorch and PyG (conda, pip, source): source Any other relevant information (e.g., version of torch-scatter): torch-scatter: 2.0.9; torch-sparse: 0.6.12

tjb-tech avatar Oct 15 '22 13:10 tjb-tech

Hi, can you use the following version: PyTorch >= 1.4.0 PyG >=1.4.0,<=1.5.1

Other versions of PyG will likely have some inconsistencies since the APIs of PyG and torch-scatter, etc. has changed a lot.

Thanks,

tailintalent avatar Nov 29 '22 05:11 tailintalent

May I know how to specify the version of PyG? According to the official install document from the PyG website, it is

pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.13.0+cu116.html

Can you show the command how to install a version with PyG=1.5.0? Thank you very much!

emma-sjwang avatar Jan 16 '23 15:01 emma-sjwang

Hi, from the prior version of the README in the PyG repo, https://github.com/pyg-team/pytorch_geometric/tree/f7c0591007fdf8cf7faac16c0b865900318dde0a,

You can find how to install older versions of PyG. For example,

pip install torch-scatter==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html pip install torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html pip install torch-spline-conv==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html pip install torch-geometric==1.5.0

Replace ${CUDA} with cu102 for example.

This will need that pytorch version of 1.5.0. I'm not sure whether the above commands still works. Another possibility is to install latest version of the PyG, but then may need to adapt to the new API so that it can work.

tailintalent avatar Jan 19 '23 07:01 tailintalent

May I know how to specify the version of PyG? According to the official install document from the PyG website, it is

pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.13.0+cu116.html

Can you show the command how to install a version with PyG=1.5.0? Thank you very much!

I have the same problem. Have you solved this problem? @emma-sjwang

sty945 avatar Feb 23 '23 09:02 sty945