问题解决:pytorch版本与cuda版本不匹配
cat /usr/local/cuda/version.txt
# 显示结果:CUDA Version 10.0.130
# CUDA 10.0
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
# CUDA 10.0
pip install torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html
得到:
CUDA Version 11.0.228
然而,使用11.0版本不匹配,只能如下解决:
pc6上遇到此问题
torch
官网上找命令,使用pip安装cuda11.1版本的。
pip3 install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
环境导出和安装的命令
目前主机:
conda create -n env
pip批量导出包含环境中所有组件的requirements.txt文件
pip freeze > requirements.txt
pip批量安装requirements.txt文件中包含的组件依赖
pip install -r requirements.txt
conda批量导出包含环境中所有组件的requirements.txt文件
conda list -e > requirements2.txt
conda批量安装requirements.txt文件中包含的组件依赖
conda install --yes --file requirements2.txt
注:
首先,用pip安装时,请先删除掉所有torch的三条。
使用文中提到的torch安装方法安装。
之后,再安装pip的其他软件。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)