安装cuda 10.1和pytorch
1、查看本机的CUDA驱动适配版本
桌面右键打开英伟达控制面板,点击系统信息->组件
所以就必须安装 10.2 及以下的版本。
2、下载CUDA 10.1和cuDNN
cuDNN下载页面:https://developer.nvidia.com/rdp/cudnn-download
下载cuDNN是需要登录英伟达开发者账户的,注册一个并填写问卷就行了,很简单。
注意:必须选择和你安装的CUDA匹配的版本
选择自定义安装 只要第一个组件即可
把cuDNN中文件夹中文件复制到对应的cuda安装目录下
3、安装Pytorch
https://pytorch.org/get-started/locally/
先更换源
1 2 3 4 5 6 | conda config - - add channels https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / pkgs / free / conda config - - add channels https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / pkgs / main / conda config - - add channels https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / cloud / msys2 / conda config - - add channels https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / cloud / conda - forge / conda config - - add channels https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / cloud / pytorch / conda config - - set show_channel_urls yes |
conda env list conda info --envs #列出所有环境 conda activate ee #激活环境 conda deactivate #退出环境 conda env remove -n py3 #删除环境 conda create -n pytorch python=3.6 #创建环境 conda activate pytorch #安装 cpu 版本的 PyTorch conda install -c pytorch pytorch-nightly-cpu #安装fastai conda install -c fastai fastai #更新conda 也可以不更新 conda update conda
1 2 | conda install pytorch torchvision cudatoolkit = 10.1 - c pytorch #安装gpu pytorch |
# 1.conda新建环境 # 2.切换到新建环境中 # 3.安装ipykernel 与 jupyter conda install ipykernel pip install jupyter # 在新建环境新建kernel(kernel名可与环境名一致) python -m ipykernel install --user --name <环境名> --display-name <在jupyter中显示的kernel名称> python -m ipykernel install --user --name pytorch --display-name Pytorch jupyter kernelspec list # 查看jupyter的kernel列表 jupyter kernelspec remove <kernel_name> # 删除指定kernel
在命令行输入jupyter notebook
切换至pytorch Kernel即可
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示