【发布时间】:2020-05-27 15:52:45
【问题描述】:
我使用 tensorflow 对 LSTM 模型进行了训练,我可以将 LSTM 生成的权重加载到 CudnnLSTM 模型中吗?我的 LSTM 代码是
lstm_cell = tf.contrib.rnn.LSTMCell(hidden_size)
outputs, (c, h) = tf.nn.dynamic_rnn(lstm_cell,
input_seq,
dtype = tf.float32)
CudnnLSTM 代码是
cudnn_cell_fw = cudnn_rnn.CudnnLSTM(num_layers = 1,
num_units = hidden_size,
direction = cudnn_rnn.CUDNN_RNN_UNIDIRECTION,
input_mode = cudnn_rnn.CUDNN_INPUT_LINEAR_MODE,
dtype = tf.float32)
outputs, (h, c) = cudnn_cell_fw(inputs = input_seq)
【问题讨论】:
标签: tensorflow lstm