using cuDNN kernel for LSTM

I ran into the same problem and fixed it by manually setting the options to use the cuDNN-compatible implementation as specified here.

"Based on available runtime hardware and constraints, this layer will choose different implementations (cuDNN-based or pure-TensorFlow) to maximize the performance. If a GPU is available and all the arguments to the layer meet the requirement of the CuDNN kernel (see below for details), the layer will use a fast cuDNN implementation."

The requirements to use the cuDNN implementation are:

  1. activation == tanh
  2. recurrent_activation == sigmoid
  3. recurrent_dropout == 0
  4. unroll is False
  5. use_bias is True
  6. Inputs, if use masking, are strictly right-padded.
  7. Eager execution is enabled in the outermost context.

In particular, I had to specify recurrent_activation == sigmoid. The version of Keras/TF I installed had a default of recurrent_activation == hard_sigmoid.