網(wǎng)站開發(fā)用c語言嗎網(wǎng)站網(wǎng)絡(luò)營銷公司
目錄
- 搭建Anaconda3
- 搭建GPU版本的Pytorch
- 你的pip也要換源,推薦阿里源
- 打開conda的PowerShell
- 驗(yàn)證
搭建Anaconda3
無腦下載安裝包安裝(自行百度)
注意點(diǎn):
1、用戶目錄下的.condarc需要配置(自定義環(huán)境的地址(別忘了給文件夾加權(quán)限);鏡像源)
搭建GPU版本的Pytorch
1、先看你的顯卡版本
Win +R -> 輸入命令nvidia-smi,看你的cuda版本
2.下載離線版本安裝包(在線也行,只要你有耐心)
https://download.pytorch.org/whl/torch_stable.html
上次網(wǎng)站找到你的對應(yīng)的cuda版本對應(yīng)的python版本的安裝包,我這里用的是python3.8
所以我的Ctrl+F 開始搜索 cu121-cp38-cp38-win
你的pip也要換源,推薦阿里源
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com
pip config list
下到本地以后準(zhǔn)備工作就已經(jīng)完成了
接下來就是安裝
打開conda的PowerShell
conda create --name nlp python==3.8.10
conda activate nlp
cd 你的whl目錄路徑
pip install ./你的文件
順序?yàn)?#xff1a;torch、torchaudio、torchvision
驗(yàn)證
import torch
print(torch.version)
print(torch.version.cuda)
torch.cuda.is_available()
print(torch.cuda.device_count())