简介

pytorch是非常流行的深度学习框架。下面是Windows平台配置pytorch的过程。

一共需要安装cuda、pycharm、anancoda、pytorch。

主要介绍cuda和pytorch的安装。

安装cuda

1. 根据自己的显卡,选择合适的cuda版本。

百度输入CUDA,进入官网下载。

python如何配置time python如何配置cuda_python

下载结束后,进行安装。

python如何配置time python如何配置cuda_python_02

安装结束后,自动弹出此窗口。

python如何配置time python如何配置cuda_python_03

一路下一步

python如何配置time python如何配置cuda_CUDA_04

在环境变量中,添加cuda的路径

python如何配置time python如何配置cuda_python_05

在cmd中验证是否安装成功

python如何配置time python如何配置cuda_python_06

可显示出CUDA版本,说明安装已成功。

2. 下载pytoch

登陆www.pytorch.org进行选择自己电脑的配置。

python如何配置time python如何配置cuda_python如何配置time_07

将下方的命令,复制到cmd中执行,注意需用管理员权限打开cmd



验证是否安装成功

python如何配置time python如何配置cuda_管理员权限_08

python如何配置time python如何配置cuda_管理员权限_09

从cmd中,进入python环境

import torch
torch.__version__
torch.cuda.is_available()

出现以下输出torch版本和'true',则说明安装成功。