AttributeError: module 'scipy.sparse' has no attribute 'coo_array'
See original GitHub issue🐛 Describe the bug
code: from torch_geometric.datasets import KarateClub dataset = KarateClub()
bug: Traceback (most recent call last): File “F:\study\python\test\test4pyg.py”, line 2, in <module> dataset = KarateClub() File “F:\anaconda\envs\ai\lib\site-packages\torch_geometric\datasets\karate.py”, line 50, in init adj = nx.to_scipy_sparse_array(G).tocoo() File “F:\anaconda\envs\ai\lib\site-packages\networkx\convert_matrix.py”, line 921, in to_scipy_sparse_array A = sp.sparse.coo_array((d, (r, c)), shape=(nlen, nlen), dtype=dtype) AttributeError: module ‘scipy.sparse’ has no attribute ‘coo_array’
Environment
- PyG version:2.0.4
- PyTorch versn:1.10.1
- OS:windows10
- Python version:3.9.7
- CUDA/cuDNN version:CU113
- How you installed PyTorch and PyG (
conda
,pip
, source):conda - Any other relevant information (e.g., version of
torch-scatter
): - pytorch-scatter:2.0.9
- pytorch-sparse:0.6.13
- pytorch-spline-conv:1.2.1
- pytorch-cluster:1.6.0
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:16 (3 by maintainers)
Top Results From Across the Web
AttributeError: module 'scipy.sparse' has no attribute 'coo_array'
The scipy.sparse.*_array functions were introduced with v1.8. The networkx package started requiring scipy >=1.8 with v2.7.
Read more >module 'scipy.sparse' has no attribute 'coo_array'
Hi,. sometimes when I use draw_networkx it returns the error in the object. For example in an ipynb I receive the following: nx.draw_networkx(...
Read more >scipy.sparse.coo_array — SciPy v1.9.3 Manual
COO is a fast format for constructing sparse arrays · Once a array has been constructed, convert to CSR or CSC format for...
Read more >Source code for sparse.coo - PyData/Sparse
It depends on NumPy and Scipy.sparse for computation, but supports arrays of ... the order of the dimensions of any :obj:`COO` array with...
Read more >AttributeError:模块'scipy.sparse'没有属性'coo_array' (module ...
AttributeError :模块'scipy.sparse'没有属性'coo_array' (module 'scipy.sparse' has no attribute 'coo_array'). _Jesse_ 已于 2022-06-05 12:30:59 修改 6836 收藏 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
coo_array
appears only in scipy version1.8.0
Looks like this is a version conflict between
networkx
andscipy
. Can you upgrade both to see if this resolves your issues?