torch.cuda.is_available()返回false
解决方法:已经安装torch的:
import platform
import torch
sysstr = platform.system()
use_cuda = torch.cuda.is_available()
print('cuda',torch.cuda.is_available(),torch._C._cuda_getDriverVersion())
daa=torch.Tensor([1,23])
print(daa.cuda())
cuda10 不行的10000 411.31 升级完412.36
后来也不行,重装torch1.2.0
http://download.pytorch.org/whl/cu100/torch-1.2.0-cp36-cp36m-win_amd64.whl
cuda10 可以的 10020 442.19
没有安装torch的:
检查CUDA版本,目前Pytorch仅支持到CUDA 10.0版本。
检查驱动,更新到新版本。
cuda,cudnn安装后,我们可以验证是否配置成功,主要使用CUDA内置的deviceQuery.exe 和 bandwithTest.exe:
首先win+R启动cmd,cd到安装目录下的 ...\extras\demo_suite
,然后分别执行bandwidthTest.exe
和deviceQuery.exe
,应该得到下图:
Result=PASS,就验证通过了