Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在1.1.0-rc2中组合注意力、多个剩余单元包装的正确方法_Python_Tensorflow - Fatal编程技术网

Python 在1.1.0-rc2中组合注意力、多个剩余单元包装的正确方法

Python 在1.1.0-rc2中组合注意力、多个剩余单元包装的正确方法,python,tensorflow,Python,Tensorflow,我试图结合以下内容: tf.contrib.rnn.AttentionCellWrapper tf.contrib.rnn.MultiRNNCell tf.contrib.rnn.ResidualWrapper tf.contrib.rnn.LSTMCell 我正在以以下方式构造单元 cell = tf.contrib.rnn.AttentionCellWrapper( tf.contrib.rnn.MultiRNNCell([ tf.contrib.rnn.Residua

我试图结合以下内容:

tf.contrib.rnn.AttentionCellWrapper
tf.contrib.rnn.MultiRNNCell
tf.contrib.rnn.ResidualWrapper
tf.contrib.rnn.LSTMCell
我正在以以下方式构造单元

  cell = tf.contrib.rnn.AttentionCellWrapper(
    tf.contrib.rnn.MultiRNNCell([
    tf.contrib.rnn.ResidualWrapper(
      cell=tf.contrib.rnn.LSTMCell(dec_units))
      for _ in range(dec_layers)]),
      attn_length=attn_len)
如果我保持attn_len较小(1-2),这可以正常工作,但是将attn_len增加到较大的值(5+)会导致脚本无限期挂起,并且在开始训练时,一个CPU内核固定在100%(完成0个步骤)

这是组合这些元素的适当方式吗?我是否应该覆盖可选参数的默认值