加载模型权重后CuDNN库兼容性错误

use*_*458 12 tensorflow cudnn magenta

我正在尝试加载NSynth权重,我正在使用tf版本1.7.0

from magenta.models.nsynth import utils
from magenta.models.nsynth.wavenet import fastgen

def wavenet_encode(file_path):

 # Load the model weights.
 checkpoint_path = './wavenet-ckpt/model.ckpt-200000'

 # Load and downsample the audio.
 neural_sample_rate = 16000
 audio = utils.load_audio(file_path, 
                          sample_length=400000, 
                          sr=neural_sample_rate)

 encoding = fastgen.encode(audio, checkpoint_path, len(audio))

 # Reshape to a single sound.
 return encoding.reshape((-1, 16))

# An array of n * 16 frames. 
wavenet_z_data = wavenet_encode(file_path)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

tensorflow/stream_executor/cuda/cuda_dnn.cc:396]加载的运行时CuDNN库:7103(兼容版本7100),但源代码是用7005编译的(兼容版本7000).如果使用二进制安装,请升级您的CuDNN库以匹配.如果从源构建,请确保在运行时加载的库与编译配置期间指定的兼容版本匹配.

我应该怎么做,我应该安装哪个版本的tf,以及我需要哪个CUDA版本?

ben*_*che 14

如错误所示,您使用的Tensorflow版本是针对CuDNN 7.0.5编译的,而您的系统安装了CuDNN 7.1.3.

正如错误也暗示,您可以解决此问题:

  • 通过安装CuDNN 7.0.5(按照以下说明操作:https://developer.nvidia.com/cudnn);
  • 或者通过自己为您的系统编译Tensorflow(按照以下说明操作:https://www.tensorflow.org/install/install_sources ).


小智 6

在env:

ubuntu16.04   
cuda9.0   
cudnn7.0  
tensorflow 1.11.0  
python 3.5
Run Code Online (Sandbox Code Playgroud)

我尝试用tensorflow训练对象检测,我遇到了这个问题:

2018-10-18 21:31:36.796017: E tensorflow/stream_executor/cuda/cuda_dnn.cc:343] Loaded runtime CuDNN library: 7.0.5 but source was compiled with: 7.2.1.  CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library.  If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
Segmentation fault (core dumped)
Run Code Online (Sandbox Code Playgroud)

这是因为tensorflow版本更高;

pip3 install --upgrade --force-reinstall tensorflow-gpu==1.9.0 --user用来解决问题.