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

光子乘羽

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

暂无评论

发表评论

相关推荐

mmdetection之dataset类解读

前言 本篇是mmdetection源码解读第二篇,主要讲解mmdetection是初始化数据类的。本文以coco数据集为例,当然,源码解读不可能面面俱到,重要的是揣摩设计者的思想以及实现过

使用PyTorch实现目标检测与跟踪

欢迎关注 “小白玩转Python”,发现更多 “有趣”引言在昨天的文章中,我们介绍了如何在PyTorch中使用您自己的图像来训练图像分类器,然后使用它来进行图像识别。本文将展示如何使用预训练的分类器检测