LSTMBlockFusedCell不支持使用outputprojectionwrapp

2024-05-14 21:46:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用LSTMBlockFusedCell替换LSTMCell以获得更好的性能,但是我发现LSTMBlockFusedCell没有输出的项目操作,所以我通过

cell = tf.contrib.rnn.OutputProjectionWrapper( 
    tf.contrib.rnn.LSTMBlockFusedCell(config.hidden_size,
                                      forget_bias=0.0,
                                      cell_clip=config.cell_clip,     
                                      use_peephole=config.use_peephole),
                                      output_size=n_outputs)

但我错了

TypeError: The argument 'cell' (<tensorflow.contrib.rnn.python.ops.lstm_ops.LSTMBlockFusedCell
object at 0x7f2c08f1eb90>) is not an RNNCell: 'output_size' property is missing,
'state_size' property is missing, 'zero_state' method is missing.

如何在LSTMBlockFusedCell中添加投影?你知道吗


Tags: configoutputsizeclipisusetfcell

热门问题