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:
- activation == tanh
- recurrent_activation == sigmoid
- recurrent_dropout == 0
- unroll is False
- use_bias is True
- Inputs, if use masking, are strictly right-padded.
- 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
.