conda一键安装pytorch-cuda环境的方法

1. 配置conda源

在windows下的user目录中的修改.condarc文件为

`

show_channel_urls: true
ssl_verify: true
channels:
  - http://conda.anaconda.org/gurobi
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - conda-forge
  - defaults
```

2. conda安装命令

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch

采用cudatoolkit10.2更加兼容多数框架, 比如笔者正在使用的cupy

检索其他cudatoolkit版本的conda命令

conda search cudatoolkit

3. 安装cupy-cuda

pip install cupy-cuda102

你可能感兴趣的:(conda一键安装pytorch-cuda环境的方法)