本质原因是: 清华源里的pytorch 没有cuda 。
https://pypi.tuna.tsinghua.edu.cn/simple/torch/

安装命令
bash
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118 -i https://pypi.tuna.tsinghua.edu.cn/simple
正确的命令
bash
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://mirrors.nju.edu.cn/pytorch/whl/cu118