ModuleNotFoundError: No module named ‘torch_sparse‘

https://github.com/rusty1s/pytorch_sparse

1、
You can now install pytorch-sparse via Anaconda for all major OS/PyTorch/CUDA combinations 🤗 Given that you have pytorch >= 1.8.0 installed, simply run

conda install pytorch-sparse -c pyg

2、
PyTorch 1.10.0
To install the binaries for PyTorch 1.10.0, simply run

pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html

where ${CUDA} should be replaced by either cpu, cu102, or cu113 depending on your PyTorch installation.

我用的第二种方法,我的cuda是11.5,命令如下:

pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu113.html

查看pytorch版本:

import torch
print(torch.__version__)  #注意是双下划线

版权声明:本文为CSDN博主「光子乘羽」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hanshuning/article/details/121682424

光子乘羽

我还没有学会写个人说明!

暂无评论

发表评论

相关推荐

cocoapi+coco20i

下载cocoapi git clone https://github.com/cocodataset/cocoapi.git 进入文件夹 cd cocoapi/PythonAPI 安装 python setup.py build_ext --i