Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CuDNN library compatibility error after loading model weights

I am trying to load NSynth weights and I am using tf version 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)

I get the following error:

tensorflow/stream_executor/cuda/cuda_dnn.cc:396] Loaded runtime CuDNN library: 7103 (compatibility version 7100) but source was compiled with 7005 (compatibility version 7000). If using a binary install, upgrade your CuDNN library to match. If building from sources, make sure the library loaded at runtime matches a compatible version specified during compile configuration.

What should I do and, which version of tf should I install, and exactly which CUDA version do I need?

like image 931
user3776458 Avatar asked Apr 21 '18 20:04

user3776458


People also ask

Is cuDNN backwards compatible?

cuDNN minor releases beginning with cuDNN 7 are binary backward-compatible with applications built against the same or earlier patch release (meaning, an application built against cuDNN 7.

How do I update cuDNN library?

Upgrading cuDNN. Navigate to the directory containing cuDNN and delete the old cuDNN bin , lib , and header files. Remove the path to the directory containing cuDNN from the $(PATH) environment variable. Reinstall a newer cuDNN version by following the steps in Installing on Windows.

How do I know if cuDNN is installed?

Step 1: Register an nvidia developer account and download cudnn here (about 80 MB). You might need nvcc --version to get your cuda version. Step 2: Check where your cuda installation is. For most people, it will be /usr/local/cuda/ .

Does Tensorflow use cuDNN?

Based on the information on the Tensorflow website, Tensorflow with GPU support requires a cuDNN version of 8.0. 4. In order to download CuDNN, you have to register to become a member of the NVIDIA Developer Program (which is free).


1 Answers

As the error says, the Tensorflow version you are using is compiled for CuDNN 7.0.5 while your system has CuDNN 7.1.3 installed.

As the error also suggests, you can solve this problem:

  • Either by installing CuDNN 7.0.5 (follow instructions here: https://developer.nvidia.com/cudnn);
  • Or by compiling Tensorflow yourself for your system (follow instructions here: https://www.tensorflow.org/install/install_sources).
like image 108
benjaminplanche Avatar answered Nov 20 '22 23:11

benjaminplanche