magicbook16, 5600H的CPU
使用miniforge安装的python。
安装CPU版本的pytorch:
conda create -n torch
conda activate torch
conda install pytorch torchvision torchaudio cpuonly -c pytorch
使用GPU的话,需要安装directml
pip install torch-directml
测试程序:
import torch
import torch_directml
dml = torch_directml.device()
tensor1 = torch.tensor([1]).to(dml) # Note that dml is a variable, not a string!
tensor2 = torch.tensor([2]).to(dml)
dml_algebra = tensor1 + tensor2
dml_algebra.item()
好像还是CPU快一些,集成显卡不行。