Pytorch和CUDA版本不兼容,运行python后(终端输入python回车)用以下代码测试
python
import torch
print(torch.__version__)
print(torch.cuda.is_available())
返回False则说明目前的pytorch版本无法使用显卡,如下图所示

接着重装合适版本的pytorch。。。