栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

错误处理:安装torch-sparse、torch-spline、torch-scatter、torch-cluster

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

错误处理:安装torch-sparse、torch-spline、torch-scatter、torch-cluster

问题描述

安装torch-sparse的时候,出现了这样的错误

pip install torch-sparse
 ValueError: underlying buffer has been detached
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:users16000appdatalocalprogramspythonpython37python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\16000\AppData\Local\Temp\pip-install-d9hgz4t9\torch-sparse_698c5c1e115f4cf0b4a5f0fa07153d3f\setup.py'"'"'; __file__='"'"'C:\Users\16000\AppData\Local\Temp\pip-install-d9hgz4t9\torch-sparse_698c5c1e115f4cf0b4a5f0fa07153d3f\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:Users16000AppDataLocalTemppip-record-ex4y0frrinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:users16000appdatalocalprogramspythonpython37Includetorch-sparse' Check the logs for full command output.

问题是安装的torch-sparse和已经安装好的torch版本不适配

解决方法 1)查看pytorch版本
>>> import torch
>>> print(torch.__version__)
1.7.1+cpu
2)去  https://pytorch-geometric.com/whl/index.html 找相应的版本

3)点开‘torch-1.7.1+cpu

4)选择相应的版本,下载之 

下载哪个版本的教程见:报错解决方法1:‘A GDAL API version must be specified.’_UQI-LIUWJ的博客-CSDN博客

5) 安装  

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/294268.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号