File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 4
4
https://pytorch.org/get-started/previous-versions/
5
5
### pip
6
6
#### 安装最新版
7
- ```
7
+ ``` shell
8
8
pip install torch torchvision torchaudio -i https://pypi.tuna.tsinghua.edu.cn/simple
9
9
```
10
10
#### 指定版本(preffered)
11
11
创建名为pytorch310的虚拟环境
12
- ```
12
+ ``` shell
13
13
conda create -n pytorch310 python==3.10
14
14
```
15
15
激活环境
16
- ```
16
+ ``` shell
17
17
conda activate pytorch310
18
18
```
19
19
设置清华源,加速安装
20
- ```
20
+ ``` shell
21
21
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
22
22
```
23
23
指定版本安装
24
- ```
24
+ ``` shell
25
25
pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html
26
26
```
27
27
### conda
28
28
添加清华镜像源
29
- ```
29
+ ``` shell
30
30
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
31
31
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
32
32
conda config --set show_channel_urls yes
33
33
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
34
34
```
35
35
#### 安装最新版
36
- ```
36
+ ``` shell
37
37
conda install pytorch torchvision torchaudio cudatoolkit=10.2
38
38
```
39
39
#### 指定版本
40
- ```
40
+ ``` shell
41
41
conda install pytorch==2.4.0 torchvision==0.19.0 torchaudio==2.4 cudatoolkit=10.2
42
42
```
43
43
You can’t perform that action at this time.
0 commit comments