win10+anaconda3+cuda9.0+cudnn+pytorch安装

安装anaonda

清华镜像:(https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/安装的是这个版本Anaconda3-2019.10-Windows-x86_64.exe
选just me
自定义安装位置
只选第2个√
一直next,直到finish
然后配置环境变量,在path中添加三个

在这里插入图片描述
就ok了!!!!!

创建虚拟环境

conda create -n py37 pyhthon=3.7py37是创建的虚拟环境名
在这里插入图片描述
在创建虚拟环境时,安装某个模块的速度太慢了,出现了错误HTTPError: HTTP 000 CONNECTION FAILED for url
可参考添加链接描述
将https改为http,但还是出错!!可能是改了.condarc文件内容,弄坏了
哭了,又出现了PackagesNotFoundError: The following packages are not available from current channels:错误
添加了清华镜像通道,还是错

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/pkgs/free/
conda config --set show_channel_urls yes

然后采用了评论中的方法
在这里插入图片描述
创建虚拟环境成功,喜大普奔!!!!
#激活虚拟环境
在这里插入图片描述
成功了
在这里插入图片描述
一般来说 conda 仓库的软件没有 PyPI 更新快和全。所以推荐 conda 只用来创建虚拟环境,包的安装管理仍然使用 pip。

安装CUDA

右键NVIDIA控制面板,看看你的电脑支持什么版本,我是CUDA9.0
在这里插入图片描述
官网下载添加链接描述
在这里插入图片描述

cudnn安装

去官网,需要注册账号添加链接描述
下载与CUDA对应的版本
在这里插入图片描述

下载pytorch

先添加中国科技大学镜像

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/pytorch

将.condarch中的-default去掉
去pytorch官网下载对应版本的pytorchhttps://pytorch.org/get-started/locally/
在这里插入图片描述
我的是,要把最后的-c pytorch去掉,不去掉他会用anaconda的镜像下载,很慢!!!!!


conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0

ok,pytorch下载完成
在这里插入图片描述
谁能想到在import torchvision 时又出错了!
在这里插入图片描述
查了一下说是pillowde版本太高,所以卸载pillow,再安装


pip uninstall Pillow
pip install Pillow==6.2.2

不知道为什么,在卸载pillow时把我的torchvision也给卸载了
在这里插入图片描述
然后我又得安上

pip install torchvision==0.3.0

然后验证一下
在这里插入图片描述
大功告成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值