graph-neural-pde icon indicating copy to clipboard operation
graph-neural-pde copied to clipboard

RuntimeError for nonexistent attribute/method 'crow_indices' of type Tensor'.

Open simonpun123 opened this issue 1 year ago • 4 comments

Hi there, I have installed the packages as stated in README.md and tried to run script run_GNN.py. It turns of I got a RuntimeError with the error message as follows:

Traceback (most recent call last): File "run_GNN.py", line 7, in from torch_geometric.nn import GCNConv, ChebConv # noqa File "/usr/local/lib/python3.7/dist-packages/torch_geometric/init.py", line 4, in import torch_geometric.data File "/usr/local/lib/python3.7/dist-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/usr/local/lib/python3.7/dist-packages/torch_geometric/data/data.py", line 20, in from torch_sparse import SparseTensor File "/usr/local/lib/python3.7/dist-packages/torch_sparse/init.py", line 41, in from .tensor import SparseTensor # noqa File "/usr/local/lib/python3.7/dist-packages/torch_sparse/tensor.py", line 13, in class SparseTensor(object): File "/usr/local/lib/python3.7/dist-packages/torch/jit/_script.py", line 974, in script _compile_and_register_class(obj, _rcb, qualified_name) File "/usr/local/lib/python3.7/dist-packages/torch/jit/_script.py", line 67, in _compile_and_register_class torch._C._jit_script_class_compile(qualified_name, ast, defaults, rcb) RuntimeError: Tried to access nonexistent attribute or method 'crow_indices' of type 'Tensor'.: File "/usr/local/lib/python3.7/dist-packages/torch_sparse/tensor.py", line 109 def from_torch_sparse_csr_tensor(self, mat: torch.Tensor, has_value: bool = True): rowptr = mat.crow_indices() ~~~~~~~~~~~~~~~~ <--- HERE col = mat.col_indices()

Can anyone explain it and maybe try to help me resolve this? Thank you

Best regards, Simon

simonpun123 avatar Sep 15 '22 22:09 simonpun123

Hi, I fixed the issue by downgrading the torch packages used in the codes.

simonpun123 avatar Sep 16 '22 17:09 simonpun123

Hi, I fixed the issue by downgrading the torch packages used in the codes.

Hi, I am facing the same issue, can I know to what version did you downgrade the packages to?

amblee0306 avatar Nov 08 '22 09:11 amblee0306