目录
- 安装anaconda
- 新建环境
- 配置源
- 安装torch,torchvision
- 测试
- 配置jupyter notebook
- 配置pycharm
1 安装anaconda
网址:
一直向下就完事了。
2 新建环境
conda create --name 环境名称 python==3.9
3 配置源
4 安装torch,torchvision
查看cuda版本,cmd输入:
nvcc --version
pytorc与cuda对应版本关系:
https://pytorch.org/get-started/previous-versions/
ctrl+F输入cuda版本如cudatoolkit=11.1,按照示例安装
pytorch与python版本对应关系:
https://pypi.org/project/torchvision/
下载whl包
https://download.pytorch.org/whl/torch_stable.html
5 测试
打开 Anaconda prompt 命令窗口,激活环境,输入:
python
import torch
torch.cuda.is_available()
返回True, 则代表安装正确。
6 配置jupyter notebook
exit() %退出python环境
使用anaconda环境
修改jupyter notebook的文件路径