DiffDock icon indicating copy to clipboard operation
DiffDock copied to clipboard

RuntimeError: object has no attribute sparse_csc_tensor:

Open Ariyaris opened this issue 1 year ago • 4 comments

It seems there is an error which I cannot resolve. Is there maybe a workaround on this matter that I could try? Thank you.

Input python -m inference --protein_ligand_csv data/protein_ligand_example_csv.csv --out_dir results/user_predictions_small --inference_steps 20 --samples_per_complex 40 --batch_size 10 --actual_steps 18 --no_final_step_noise Output Traceback (most recent call last): File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/lbilic/DiffDock/inference.py", line 10, in from torch_geometric.loader import DataLoader File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch_geometric/init.py", line 4, in import torch_geometric.data File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch_geometric/data/data.py", line 9, in from torch_sparse import SparseTensor File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch_sparse/init.py", line 40, in from .tensor import SparseTensor # noqa File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch_sparse/tensor.py", line 13, in class SparseTensor(object): File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/jit/_script.py", line 1302, in script _compile_and_register_class(obj, _rcb, qualified_name) File "/home/lbilic/anaconda3/envs/diffdock/lib/python3.9/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/lbilic/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch_sparse/tensor.py", line 520 value = torch.ones(self.nnz(), dtype=dtype, device=self.device())

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

System WSL2 Ubuntu22:

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Tue_May__3_18:49:52_PDT_2022 Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0

Python 3.9.17 (main, Jul 5 2023, 20:41:20) [GCC 11.2.0] :: Anaconda, Inc. on linux

NVIDIA-SMI 535.54.04 Driver Version: 536.25 CUDA Version: 12.2

Ariyaris avatar Jul 19 '23 14:07 Ariyaris

Same

ianandersonlol avatar Jul 28 '23 04:07 ianandersonlol

Hi,

This error occurs at from torch_geometric.loader import DataLoader so it must be a problem with (the installation of) PyTorch Geometric and its related packages. My recommendation is to uninstall these packages or directly use a new environment, download the version of Pytorch that is relevant to your cuda version, and then download the version of pytorch geometric for the same cuda version. If the error persists I recommend trying to raise an issue on the pytorch geometric repo as they might be able to help further.

I hope this helps, Gabriele

gcorso avatar Jul 30 '23 16:07 gcorso

I had the same error as you. And I solved the error by downlgrading the torch-sparse's vertion to 0.6.14. You could have a try:)

MsCongs avatar Aug 23 '23 13:08 MsCongs

I had the same error as you. And I solved the error by downlgrading the torch-sparse's vertion to 0.6.14. You could have a try:)

Thanks, it's helpful for me.

UR-Free avatar Aug 27 '23 11:08 UR-Free