Problem Description
PyTorch
I torch-geometric
had AttributeError: module 'torch' has no attribute 'sparse_csc'
this using and .
AttributeError: module 'torch' has no attribute 'sparse_csc'
Cause Analysis:
At first I thought it torch
was a version problem, but later I tried a lot of versions but torch-geometric
it didn't work. I checked the version later and found that it was a problem torch-geometric
with .
When I call torch.sparse_csc()
the function , the Python interpreter torch
looks for sparse_csc
the attribute . If the attribute cannot be found, the Python interpreter throws AttributeError
an exception , telling you that the attribute does not exist.
torch-geometric
Implementation and support for sparse_csc
the attribute , so you can use the attribute without AttributeError
errors in the new version.
solution:
The version I torch-geometric
used was the latest version 2.3.0
, and then I changed it to 2.1.0
and . You can take a look at my dependencies, as follows:
torch 1.11.0+cu113
torch-cluster 1.6.0
torch-geometric 2.1.0
torch-scatter 2.0.9
torch-sparse 0.6.13
torch-spline-conv 1.2.1
torchvision 0.12.0+cu113
You can install according to my environment.