python - 训练 StyleGan 时出现 CUDNN_STATUS_NOT_INITIALIZED 错误
问题描述
我从https://github.com/NVlabs/stylegan下载了 stylegan 代码,并想用我的数据集对其进行训练。我正在使用 ubuntu 机器(Ubuntu 18.04.3 LTS)和
python train.py
给出一个错误,说:
2020-01-26 23:30:27.115726: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
2020-01-26 23:30:27.115811: E tensorflow/stream_executor/cuda/cuda_dnn.cc:337] Possibly insufficient driver version: 430.50.0
这是我的 cuda、cudnn 和 pip 列表的输出:
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
$nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.50 Driver Version: 430.50 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 2060 Off | 00000000:01:00.0 On | N/A |
| 42% 37C P8 14W / 170W | 529MiB / 5931MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1100 G /usr/lib/xorg/Xorg 245MiB |
| 0 1578 G /usr/bin/gnome-shell 149MiB |
| 0 2179 G ...quest-channel-token=1359353350696709871 132MiB |
+-----------------------------------------------------------------------------+
$dpkg -l | grep -i cudnn
ii libcudnn7 7.6.5.32-1+cuda10.2 amd64 cuDNN runtime libraries
ii libcudnn7-dev 7.6.5.32-1+cuda10.2 amd64 cuDNN development libraries and headers
$pip list
absl-py (0.9.0)
astor (0.8.1)
bleach (1.5.0)
certifi (2019.11.28)
chardet (3.0.4)
gast (0.3.3)
google-pasta (0.1.8)
grpcio (1.26.0)
h5py (2.10.0)
html5lib (0.9999999)
idna (2.8)
Keras-Applications (1.0.8)
Keras-Preprocessing (1.1.0)
Markdown (3.1.1)
mock (3.0.5)
numpy (1.18.1)
opencv-python (4.1.0.25)
Pillow (6.1.0)
pip (9.0.1)
pkg-resources (0.0.0)
protobuf (3.11.2)
requests (2.22.0)
scipy (1.2.0)
setuptools (45.1.0)
six (1.14.0)
tensorboard (1.14.0)
tensorflow-estimator (1.14.0)
tensorflow-gpu (1.14.0)
termcolor (1.1.0)
tqdm (4.32.2)
urllib3 (1.25.7)
Werkzeug (0.16.0)
wheel (0.33.6)
wrapt (1.11.2)
absl-py (0.9.0)
astor (0.8.1)
bleach (1.5.0)
certifi (2019.11.28)
chardet (3.0.4)
gast (0.3.3)
google-pasta (0.1.8)
grpcio (1.26.0)
h5py (2.10.0)
html5lib (0.9999999)
idna (2.8)
Keras-Applications (1.0.8)
Keras-Preprocessing (1.1.0)
Markdown (3.1.1)
mock (3.0.5)
numpy (1.18.1)
opencv-python (4.1.0.25)
Pillow (6.1.0)
pip (9.0.1)
pkg-resources (0.0.0)
protobuf (3.11.2)
requests (2.22.0)
scipy (1.2.0)
setuptools (45.1.0)
six (1.14.0)
tensorboard (1.14.0)
tensorflow-estimator (1.14.0)
tensorflow-gpu (1.14.0)
termcolor (1.1.0)
tqdm (4.32.2)
urllib3 (1.25.7)
Werkzeug (0.16.0)
wheel (0.33.6)
wrapt (1.11.2)
有没有人知道我可以运行 stylegan 的这些工具的特定版本?
解决方案
为了社区的利益,在此处(答案部分)提供解决方案,即使它出现在评论部分。
首先需要删除所有cuDNN文件
rm -f /usr/include/cudnn.h
rm -f /usr/lib/x86_64-linux-gnu/*libcudnn*
rm -f /usr/local/cuda-/lib64/*libcudnn
现在从这里提取新的 cuDNN
要下载 cuDNN,请确保您已注册NVIDIA Developer Program。
- 转至:NVIDIA cuDNN 主页。
- 单击下载。
- 完成简短调查并单击提交。
- 接受条款和条件。显示 cuDNN 的可用下载版本列表。
- 选择要安装的 cuDNN 版本。显示可用资源列表。
请在此处检查 Tensorflow GPU 的已测试构建配置
将以下文件复制到CUDA Toolkit目录下,并更改文件权限
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
有关更多详细信息,请参阅此处的 cuDNN 安装指南
注意:更新 cuDNN 后,如果 TensorFlow 抱怨,则相应地更新 TensorFlow
推荐阅读
- c# - Tcp Listner 变量重用!!C#
- openscad - OpenSCAD 变量未累积
- amazon-web-services - “f在这个时候是出乎意料的。” 尝试从 AWS CLI 递归批量重命名 S3 文件时出错
- html - CSS 显示所有空格并打破自动换行
- python - 将 subprocess.getoutput 与 join 一起使用会导致 TypeError
- sorting - 如何对多个自动谷歌表进行排序
- python - Python yaml 导入失败并显示“NameError:未定义名称'Serializer'
- flutter - Flutter Auto Route:如何以编程方式设置初始路由?
- python - 我们如何在 matplotlib 中向一个方向添加间距?
- java - Spring Actuator 不映射到 localhost:xxxx/actuator