Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonpun123 opened this issue Sep 15, 2022 · 4 comments

Comments

@simonpun123
Copy link

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
Copy link
Author

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

@amblee0306
Copy link

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?

@alanjohnvarghese
Copy link

alanjohnvarghese commented Jun 29, 2023

Hi!

I too was facing the same issue. I fixed it by using the versions mentioned in the pyG_install.sh file

@simonpun123
Copy link
Author

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?

Sorry, I forgot. You may follow the version listed in the README file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants