深度学习tensorflow与pytorch环境安装(Win10)

1 anaconda 下载

去往官网下载anaconda,速度非常快。
https://www.anaconda.com/products/individual#download-section

2 安装pycharm

去往Jetbrains官网下载pycharm。
https://www.jetbrains.com/pycharm/download/#section=windows

3 安装pytorch环境

3.1修改下载目录为清华源

在anaconda prompt中,粘贴如下代码,将下载路径切换为清华源。
在这里插入图片描述

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/
conda config --set show_channel_urls yes
conda config --set remote_read_timeout_secs 1000.0

或者我们也可以按图中目录打开.condarc文件。
在这里插入图片描述
全选已有内容,将以下内容粘贴覆盖保存。

ssl_verify: true
show_channel_urls: true

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/
remote_read_timeout_secs: 1000.0

3.2 了解自己电脑显卡驱动版本

去往控制面板,并点击NVIDIA控制面板。
在这里插入图片描述
NVIDIA控制面板中点击“帮助”下面的“系统信息”。
在这里插入图片描述
查看驱动程序版本,我的显卡驱动版本是399.24。
在这里插入图片描述
根据显卡驱动版本确定自己能使用的CUDA Tookit版本。我的显卡驱动版本是388.57,介于385.54和391.29之间,由下图可知,我应该使用的CUDA Tookit版本是CUDA 9.2。
在这里插入图片描述

3.3 安装正确的tensorflow-gpu版本

在这里插入图片描述
这里需要注意,安装tensorflow1.x版本时对应的python版本最好是3.6。

打开anaconda prompt,通过以下命令新建虚拟环境并进入,安装对应的tensorflow版本。

conda create -n deep_learning python=3.6
#(首先要确保自己在之前创建的DPlearning_3.6环境下)
activate deep_learning 
 
#安装Tensorflow-gpu 1.9.0版本
conda install tensorflow-gpu=1.9.0

3.3 安装pytorch

可以去官网(https://pytorch.org/)查看适合自己电脑的pytorch版本,再通过命令下载。

如果你安装的python版本是3.7或者之前的版本,那么在下载安装 pytorch 时就要考虑下载合适的版本。

conda install pytorch==1.5.1 torchvision cudatoolkit=9.2
#安装成功后进入python环境中验证一下
python
import torch
print(torch.cuda.is_available())   #结果为True就说明成功了

参考:
手把手教你:Windows系统上安装GPU深度学习环境
pytorch快速安装【清华源】
python3.8无法安装tensorflow,安装其他python版本
CondaError: Downloaded bytes did not match Content-Length
Anaconda建立新的环境,出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url … 解决过程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值