[work] 验证pytorch gpu正确安装
This is going to work :In [1]: import torchIn [2]: torch.cuda.current_device()Out[2]: 0In [3]: torch.cuda.device(0)Out[3]: <torch.cuda.device at 0x7efce0b03be0>In [4]: torch.cuda.devi...
·
This is going to work :
In [1]: import torch
In [2]: torch.cuda.current_device()
Out[2]: 0
In [3]: torch.cuda.device(0)
Out[3]: <torch.cuda.device at 0x7efce0b03be0>
In [4]: torch.cuda.device_count()
Out[4]: 1
In [5]: torch.cuda.get_device_name(0)
Out[5]: 'GeForce GTX 950M'
This tells me the GPU GeForce GTX 950M is being used by PyTorch.
更多推荐
所有评论(0)