starting with cuDNN : failed to initialize

Got this error on windows 10

UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node conv2d_1/convolution}} = Conv2D[T=DT_FLOAT, _class=[“loc:@training_1/Adam/gradients/conv2d_1/convolution_grad/Conv2DBackpropFilter”], data_format=“NCHW”, dilations=[1, 1, 1, 1], padding=“VALID”, strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](training_1/Adam/gradients/conv2d_1/convolution_grad/Conv2DBackpropFilter-0-TransposeNHWCToNCHW-LayoutOptimizer, conv2d_1/kernel/read)]]
[[{{node loss_1/mul/_267}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name=“edge_782_loss_1/mul”, tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

I have RTx 2070 and :

Python 3.6.5
tf 1.12.0
tf-gpu 1.12.0
cuda 9.0
cudnn 7.3.1
keras 2.2.4

I know nvdia page for cudnn so please don’t copy paste it here. I am interested in small details that are missing. For example, you can’t install cuda unless you go custom and uncheck the visual studio option.

Cuda seems to work fine, python sees it, also matlab sees it.

The error happens while running this code for mnist that I got from the web, which works if I uninstall tensorflow-gpu and use tensorflow on cpu.

Thank you in advance !

from IPython import get_ipython
get_ipython().magic(‘reset -sf’)
import os

import numpy as np
np.random.seed(123) # for reproducibility
import tensorflow as tf
tf.set_random_seed(123)

from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import np_utils
from keras.datasets import mnist

batch_size = 128

4. Load pre-shuffled MNIST data into train and test sets

(X_train, y_train), (X_test, y_test) = mnist.load_data()

5. Preprocess input data

X_train = X_train.reshape(X_train.shape[0], 28, 28, 1)
X_test = X_test.reshape(X_test.shape[0], 28, 28, 1)
X_train = X_train.astype(‘float32’)
X_test = X_test.astype(‘float32’)
X_train /= 255
X_test /= 255

6. Preprocess class labels

Y_train = np_utils.to_categorical(y_train, 10)
Y_test = np_utils.to_categorical(y_test, 10)

7. Define model architecture

model = Sequential()

model.add(Convolution2D(32, (6, 6), activation=‘relu’, input_shape=(28,28,1)))
model.add(Convolution2D(20, (6, 6), activation=‘relu’))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Dropout(0.25))

model.add(Flatten())
model.add(Dense(128, activation=‘relu’))
model.add(Dropout(0.4))
model.add(Dense(10, activation=‘softmax’))

8. Compile model

model.compile(loss=‘categorical_crossentropy’,
optimizer=‘adam’,
metrics=[‘accuracy’])

9. Fit model on training data

model.fit(X_train, Y_train,
batch_size=batch_size, epochs=10, verbose=1,
validation_data=(X_test, Y_test))
model.save(‘model.h5’)

10. Evaluate model on test data

score = model.evaluate(X_test, Y_test, verbose=0)
print(‘Test loss:’, score[0])
print(‘Test accuracy:’, score[1])

Exactly same error for me with minst and other images recognised convolution 3d python implementation with tensorflow-gpu 1.12, on Windows 10 cuda9.0 and cudnn 7.0.5 on nvidia 1060 graphics . Any pointers where I can check about what is causing thus error? Can it be any permissions environment setup or issues?

I have Same problem but solved with downgrade tensorflow version to 1.8.

i have the same problem tf==2.0.0