1,打开pytorch官网https://pytorch.org/get-started/locally/
2,选择相应的版本
![](https://img-blog.csdnimg.cn/img_convert/586b7f17d496cbdff184cfa639f48c6d.png)
3,复制run this command这部分的内容到命令行界面
![](https://img-blog.csdnimg.cn/img_convert/6e91da4d984ab0081bdf7f9c3b116e52.png)
4,等待下载
![](https://img-blog.csdnimg.cn/img_convert/12a397b3104471924b5fe882d1f3f561.png)
5,进行验证
python
import torch
x = torch.rand(5,3)
print(x)
![](https://img-blog.csdnimg.cn/img_convert/e33692880edd0141438f9fef383ae89b.png)
6,查看pytorch版本
python
import torch
print(torch.__version__)
![](https://img-blog.csdnimg.cn/img_convert/a51428eca04b6ab6d543e57d2840bd17.png)
7,安装成功
1,打开pytorch官网https://pytorch.org/get-started/locally/
2,选择相应的版本
3,复制run this command这部分的内容到命令行界面
4,等待下载
5,进行验证
python
import torch
x = torch.rand(5,3)
print(x)
6,查看pytorch版本
python
import torch
print(torch.__version__)
7,安装成功