然后在pycharm上运行会显示 Torch not compiled with CUDA enabled

解决办法:使pycharm进入终端base的解释器,

 

更多推荐

torch.cuda.is_available()在终端true,在pycharm返回false