File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,30 @@ pip install torch torchvision torchaudio --index-url https://pytorch.org/get-sta
109
109
# pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # Older GPUs
110
110
```
111
111
112
+ 这里要注意一个问题,就是如果显卡可以就到这个网站去安装对应版本的软件,否者上面命令安装后是使用cpu驱动的,会慢的要死,你的GPU更不没有跑起来。
113
+
114
+ https://pytorch.org/get-started/previous-versions/
115
+
116
+ ```
117
+ # CUDA 11.8
118
+ conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=11.8 -c pytorch -c nvidia
119
+ # CUDA 12.1
120
+ conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.1 -c pytorch -c nvidia
121
+ # CUDA 12.4 《-- 我当时用的这个,说是可以向下兼容,AI一下对应的python版本
122
+ conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.4 -c pytorch -c nvidia
123
+ # CPU Only
124
+ conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 cpuonly -c pytorch
125
+ ```
126
+
127
+ 可以用这个代码检测显卡是否用起来没有。
128
+
129
+ ```
130
+ import torch
131
+ print(torch.__version__) # 查看PyTorch版本
132
+ print(torch.cuda.is_available()) # 应输出 True
133
+ print(torch.cuda.get_device_name(0)) # 应显示显卡型号(如 "GeForce RTX 3080")
134
+ ```
135
+
112
136
113
137
114
138
### ** 5.下载模型**
You can’t perform that action at this time.
0 commit comments