python查看torch、cuda、cudnn版本

 import torch

1、查看torch版本

print("Hello World, Hello PyTorch {}".format(torch.__version__))
Hello World, Hello PyTorch 1.8.1+cu101

2、查看cuda版本

print("\nCUDA is available:{}, version is {}".format(torch.cuda.is_available(), torch.version.cuda))

CUDA is available:True, version is 10.1

3、查看cudnn

print(torch.backends.cudnn.version())
7603

4、查看device

print("\ndevice_name: {}".format(torch.cuda.get_device_name(0)))
device_name: TITAN Xp

猜你喜欢

转载自blog.csdn.net/qq_53086461/article/details/129432307
今日推荐