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

Issue with torch-sparse #5

Open
miriamcarnot opened this issue Oct 30, 2024 · 1 comment
Open

Issue with torch-sparse #5

miriamcarnot opened this issue Oct 30, 2024 · 1 comment

Comments

@miriamcarnot
Copy link

Dear authors,
thank you for your work. I am trying to run the training and I installed all the dependencies as mentioned in the readme.
I am encountering the following error:

Traceback (most recent call last):
  File "/home/carnot/projects/UDA/saluda/train_single_back.py", line 5, in <module>
    from general_imports import *
  File "/home/carnot/projects/UDA/saluda/general_imports.py", line 8, in <module>
    import torch_geometric.transforms as T
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_geometric/__init__.py", line 4, in <module>
    import torch_geometric.data
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_geometric/data/__init__.py", line 1, in <module>
    from .data import Data
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_geometric/data/data.py", line 3, in <module>
    from torch_geometric.typing import OptTensor, NodeType, EdgeType
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_geometric/typing.py", line 4, in <module>
    from torch_sparse import SparseTensor
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_sparse/__init__.py", line 40, in <module>
    from .tensor import SparseTensor  # noqa
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_sparse/tensor.py", line 13, in <module>
    class SparseTensor(object):
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch/jit/_script.py", line 1302, in script
    _compile_and_register_class(obj, _rcb, qualified_name)
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch/jit/_recursive.py", line 44, in _compile_and_register_class
    script_class = torch._C._jit_script_class_compile(qualified_name, ast, defaults, rcb)
RuntimeError:
object has no attribute sparse_csc_tensor:
  File "/home/carnot/miniconda3/envs/torchsparse/lib/python3.10/site-packages/torch_sparse/tensor.py", line 585
            value = torch.ones(self.nnz(), dtype=dtype, device=self.device())

        return torch.sparse_csc_tensor(colptr, row, value, self.sizes())
               ~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE

torch_geometric requires me to install torch-sparse which is a different library than torchsparse. Do you use both? And if yes, which version of torch-sparse and torch_geometric are you using?

Thank you for your help and best regards :)

@BjoernMichele
Copy link
Collaborator

Dear @miriamcarnot ,

Thank you for your interest in our work.

Unfortunately, I have no access any more to my former dockerfile and can't give you the exact version numbers that I have used. I just recall that I used the versions matching to my cuda (11.3) and pytorch (1.11.0) versions.

I shortly tested the repo with my current setup (based on PyTorch 2.0.0, Cuda 11.7 and this Torchsparse commit: https://github.com/mit-han-lab/torchsparse.git@69c1034ddb285798619380537802ea0ff03aeba6). There were a few changes needed in some transformation functons but which have highly probably not caused your error.

With this new setup I could start a training without any errors.

In this new setup I use the following libraries:
torch-cluster 1.6.3+pt20cu117
torch-geometric 2.6.1
torch-scatter 2.1.2+pt20cu117
torch-sparse 0.6.18+pt20cu117

The error that you report appears familiar to me, but I can't recall the source or solution for it.

I hope this nevertheless can help you a bit.

With best regards,
Bjoern

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

2 participants