tensorflow2.0 - 为什么没有 CuDNN?
问题描述
我在 Ubuntu 20.04 上使用 Nvidia GeForce GTX 1660 进行机器学习。我遵循了设置过程,似乎我的 tensorflow 正在使用 GPU,因为我得到了以下输出。
$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.config.list_physical_devices(device_type='GPU')
2021-10-22 15:02:49.664511: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-10-22 15:02:49.672338: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-10-22 15:02:49.675114: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:937] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
>>> from tensorflow.python.platform import build_info as build
>>> print(f"tensorflow version: {tf.__version__}")
tensorflow version: 2.6.0
>>> print(f"Cuda Version: {build.build_info['cuda_version']}")
Cuda Version: 11.2
>>> print(f"Cudnn version: {build.build_info['cudnn_version']}")
Cudnn version: 8
>>>
但是,如果我尝试验证我的 CuDNN 安装,它似乎不存在。
$ cat /usr/local/cuda/include/cudnn_version.h
$ cat: /usr/local/cuda/include/cudnn_version.h: No such file or directory
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0
虽然我像这样运行安装
apt-get --assume-yes install cuda nvidia-cuda-toolkit
基本上,我遵循了一些程序,但从未全面了解组件是什么以及组件如何相互依赖,例如 Cuda、CuDNN、NVCC、Nvidia 驱动程序、Tensorflow 等。所以关于 tensorflow 如何工作的任何帮助虽然没有 CuDNN,但将不胜感激。
需要注意的是,即使是 NVCC 和 Cuda 似乎也从不同的界面显示了完全不同的版本。
解决方案
推荐阅读
- javascript - 打字稿:将对象用作属性-正确的方法是:
- python - 如果不可用,则添加列 Pandas
- flutter - Flutter - 未处理的异常:错误:找不到正确的提供程序
在此 SliverList 小部件上方 - sql - SQL:选择每个类别的第一个值并转换数据集以显示 FROM 和 TO 关系
- reactjs - 在 FlatList 中取 100% 宽度 - React Native
- python - 无法在一次执行中从 python 执行 SQL 命令序列
- git - 我可以使用 git push origin master:myBranch 将我在 master 分支中修改的代码推送到我的分支吗?
- html - 打印时背景图像显示不正确(另存为 PDF)但可以使用
- python - 为什么我无法在 python 中使用 selenium 抓取同一网站的多个 URL?
- node.js - 在节点后面触发getSignedUrl函数,传递到前面