1.问题原因:安装的事pytorch CPU版本;

2解决办法:
卸载已安装的pytorch,安装GPU 版本的pytorch
安装命令如下:
pip3 install torch torchaudio -i https://pypi.tuna.tsinghua.edu.cn/simple安装过程有点长,安装过程运行如下:

安装完后验证是否安装成功:
import torch
torch.cuda.is_available()
显示True,代表安装成功啦!
接着就可以正常运行自己的代码啦。。。









