PyTorch,Tensorflow,cuda以及Nvidia驱动官方安装方式

x33g5p2x  于2021-12-06 转载在 其他  
字(0.9k)|赞(0)|评价(0)|浏览(236)

一. PyTorch

1. PyTorch官方安装方式:

链接: https://pytorch.org/get-started/previous-versions/

通过whl安装: http://download.pytorch.org/whl/torch_stable.html.

2. 查看Pytorch版本:

import torch

print(torch.__version__)   #查看torch版本

torch.cuda.is_available()   #查看torch-gpu版本是否可用

torch.cuda.device_count()    #返回gpu数量

二. Tensorflow

1. Tensorflow安装方式:

链接: https://wiki.jikexueyuan.com/project/tensorflow-zh/get_started/os_setup.html

2. 查看Tensorflow版本:

import tensorflow as tf

tf.__version__  #查看版本

tf.__path__  #查看安装位置

tf.test.is_gpu_available()   #查看gpu版本是否可用

三. cuda

1. cuda官方安装方式:

链接: https://developer.nvidia.com/cuda-toolkit-archive

2. cuda版本:

import torch

print(torch.version.cuda)  #查看cuda版本

torch.backends.cudnn.version()  #查看cudnn版本

torch.cuda.get_device_name(0)   #查看显卡类型

3. cudnn官方下载(需注册):

链接: https://developer.nvidia.com/rdp/cudnn-archive

四. Nvidia驱动

1. linux查看显卡类型:

lspci | grep -i nvidia

2. 查看NVIDIA驱动版本

sudo dpkg --list | grep nvidia-*
或者
cat /proc/driver/nvidia/version

3. 驱动下载地址:
链接: https://www.nvidia.cn/Download/index.aspx?lang=cn

相关文章

微信公众号

最新文章

更多