LSTM 的 cuDNN 内核标准
cuDNN kernel criteria for LSTM
我正在尝试使用 cuDNN 内核来训练 LSTM 生成模型以加快该过程,但我的模型似乎不符合标准。
我无法理解到底是什么问题。
这是警告:
WARNING:tensorflow:Layer lstm will not use cuDNN kernel since it doesn't meet the cuDNN kernel criteria. It will use generic GPU kernel as fallback when running on GPU
这是我的生成模型:
def build_generative_model(vocab_size, embed_dim, lstm_units, lstm_layers, batch_size, dropout=0):
model = tf.keras.Sequential()
model.add(tf.keras.layers.Embedding(vocab_size, embed_dim, batch_input_shape=[batch_size, None]))
for i in range(max(1, lstm_layers)):
model.add(tf.keras.layers.LSTM(lstm_units, return_sequences=True, stateful=True, dropout=dropout, recurrent_dropout=dropout))
model.add(tf.keras.layers.Dense(vocab_size))
return model
我修好了,我觉得好傻哈哈哈。
对于遇到此问题的任何人,请查看要求:https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM
慢慢浏览每个图层并将图层设置为适当的值,在我的例子中
recurrent_dropout = 0
而不是
recurrent_dropout = 0.0
我正在尝试使用 cuDNN 内核来训练 LSTM 生成模型以加快该过程,但我的模型似乎不符合标准。 我无法理解到底是什么问题。
这是警告:
WARNING:tensorflow:Layer lstm will not use cuDNN kernel since it doesn't meet the cuDNN kernel criteria. It will use generic GPU kernel as fallback when running on GPU
这是我的生成模型:
def build_generative_model(vocab_size, embed_dim, lstm_units, lstm_layers, batch_size, dropout=0):
model = tf.keras.Sequential()
model.add(tf.keras.layers.Embedding(vocab_size, embed_dim, batch_input_shape=[batch_size, None]))
for i in range(max(1, lstm_layers)):
model.add(tf.keras.layers.LSTM(lstm_units, return_sequences=True, stateful=True, dropout=dropout, recurrent_dropout=dropout))
model.add(tf.keras.layers.Dense(vocab_size))
return model
我修好了,我觉得好傻哈哈哈。 对于遇到此问题的任何人,请查看要求:https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM 慢慢浏览每个图层并将图层设置为适当的值,在我的例子中
recurrent_dropout = 0
而不是
recurrent_dropout = 0.0