File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1
1
# PyTorch
2
+ ## Installation
3
+ ### 根据OS和cuda选择适配的torch版本
4
+ https://pytorch.org/get-started/previous-versions/
5
+ ### pip
6
+ #### 安装最新版
7
+ ``` shell
8
+ pip install torch torchvision torchaudio -i https://pypi.tuna.tsinghua.edu.cn/simple
9
+ ```
10
+ #### 指定版本(preffered)
11
+ 创建名为pytorch310的虚拟环境
12
+ ``` shell
13
+ conda create -n pytorch310 python==3.10
14
+ ```
15
+ 激活环境
16
+ ``` shell
17
+ conda activate pytorch310
18
+ ```
19
+ 设置清华源,加速安装
20
+ ``` shell
21
+ pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
22
+ ```
23
+ 指定版本安装
24
+ ``` shell
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
+ ```
27
+ ### conda
28
+ 添加清华镜像源
29
+ ``` shell
30
+ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
31
+ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
32
+ conda config --set show_channel_urls yes
33
+ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
34
+ ```
35
+ #### 安装最新版
36
+ ``` shell
37
+ conda install pytorch torchvision torchaudio cudatoolkit=10.2
38
+ ```
39
+ #### 指定版本
40
+ ``` shell
41
+ conda install pytorch==2.4.0 torchvision==0.19.0 torchaudio==2.4 cudatoolkit=10.2
42
+ ```
43
+
44
+ ## Tutorial
2
45
- [ pytorch examples] ( https://github.com/pytorch/examples )
3
46
- [ pytorch tutorials] ( https://github.com/pytorch/tutorials )
4
47
- pytorch模型性能分析和优化: [ weixin] ( https://mp.weixin.qq.com/s/lxJthBk1L2nYOyQyLbqqEw )
You can’t perform that action at this time.
0 commit comments