title: cannot train Keras convolution network on GPU
body: <p>I can train a Keras network with <code>Dense</code> layer using <code>keras.datasets.fashion_mnist</code> dataset.  However, when I tried to train a convolutional network, I got an error.</p>
  
  <p>Here is some part of the code:</p>
  
  <pre><code>from tensorflow.keras.layers import *
  
  model = keras.Sequential([
          Convolution2D(16, (3,3), activation='relu', input_shape=(28,28,1)),
          MaxPooling2D(pool_size=(2,2)),
          Flatten(),
          Dense(16, activation='relu'),
          Dense(10, activation='softmax')    
  ])
  model.compile(optimizer=tf.train.AdamOptimizer(), 
            loss='sparse_categorical_crossentropy',
            metrics=['accuracy'])
  
  model.fit(train_images, train_labels, epochs=5)
  </code></pre>
  
  <p>and its error when I tried to fit.</p>
  
  <blockquote>
    <p>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/Conv2D}} =
    Conv2D[T=DT_FLOAT, 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/TFOptimizer/gradients/conv2d/Conv2D_grad/Conv2DBackpropFilter-0-TransposeNHWCToNCHW-LayoutOptimizer,
    conv2d/Conv2D/ReadVariableOp)]]    [[{{node
    loss/dense_1_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2/_69}}
    = _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_112_l...t/Switch_2",
    tensor_type=DT_INT32,
    _device="/job:localhost/replica:0/task:0/device:CPU:0"]]</p>
  </blockquote>
  
  <p>I have <code>cudnn64_7.dll</code> in <code>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin</code> and the <code>PATH</code> is already contain that folder.</p>