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

Testing a single experiment: tried to access nonexistent attribute or method. #43

Open
florianscheidl opened this issue Jul 1, 2022 · 0 comments

Comments

@florianscheidl
Copy link

florianscheidl commented Jul 1, 2022

-- EDIT --

Hi, I experienced an issue when following your instructions and testing the installation.
I'm using Ubuntu 20.04 and installed the CPU version of Pytorch.

When testing the single experiment (bash run_single_cpu.sh), I got the following error:

Traceback (most recent call last):
  File "main.py", line 5, in <module>
    from torch_geometric import seed_everything
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-packages/torch_geometric/__init__.py", line 4, in <module>
    import torch_geometric.data
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-packages/torch_geometric/data/__init__.py", line 1, in <module>
    from .data import Data
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-packages/torch_geometric/data/data.py", line 9, in <module>
    from torch_sparse import SparseTensor
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-packages/torch_sparse/__init__.py", line 41, in <module>
    from .tensor import SparseTensor  # noqa
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-packages/torch_sparse/tensor.py", line 13, in <module>
    class SparseTensor(object):
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-packages/torch/jit/_script.py", line 974, in script
    _compile_and_register_class(obj, _rcb, qualified_name)
  File "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-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 "/home/flo/miniconda3/envs/graphgym/lib/python3.7/site-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()

I found a seemingly closely related problem, see this post: rusty1s/pytorch_sparse#207
and tried to resolve it by downgrading to an older torch-sparse version:

pip install torch-sparse==0.6.12

This seemed to fix the issue.

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

1 participant