Tensorflow ValueError: Attempt to reuse RNNCell with a different variable scope than its first
来源:互联网 发布:篮球突破技巧 知乎 编辑:程序博客网 时间:2024/06/08 19:43
Reference:
https://stackoverflow.com/questions/42669578/tensorflow-1-0-valueerror-attempt-to-reuse-rnncell-with-a-different-variable-s
原本代码:
cell = tf.contrib.rnn.LSTMCell(state_size, state_is_tuple=True)rnn_cells = tf.contrib.rnn.MultiRNNCell([cell for _ in range(num_layers)], state_is_tuple = True)outputs, current_state = tf.nn.dynamic_rnn(rnn_cells, x, initial_state=rnn_tuple_state, scope = "layer")
修改后:
def lstm_cell(): return tf.contrib.rnn.LSTMCell(state_size, reuse=tf.get_variable_scope().reuse)rnn_cells = tf.contrib.rnn.MultiRNNCell([lstm_cell() for _ in range(num_layers)], state_is_tuple = True)outputs, current_state = tf.nn.dynamic_rnn(rnn_cells, x, initial_state=rnn_tuple_state)
阅读全文
0 0
- Tensorflow ValueError: Attempt to reuse RNNCell with a different variable scope than its first
- ValueError: Attempt to have a second RNNCell use the weights of a variable scope already has weights
- intermediate javascript: assign a function with its parameter to a variable and execute later
- Attempt to refer to a unregistered pool by its alias '**'
- tensorflow:name&variable scope
- Tensorflow: RNNCell
- tensorflow学习笔记: variable scope
- 转载!tensorflow name scope和variable scope
- Can a local variable's memory be accessed outside its scope?
- Can a local variable's memory be accessed outside its scope?
- What's the difference of name scope and a variable scope in tensorflow?
- What's the difference of name scope and a variable scope in tensorflow?
- Attempt to refer to a unregistered pool by its alias 'xxx'
- paip.proxool连接池 :Attempt to refer to a unregistered pool by its alias 'xx'
- Attempt to refer to a unregistered pool by its alias 'xxx'
- hibernate4+spring3.1+proxool0.9.1 出现 Attempt to refer to a unregistered pool by its alias
- java--proxool.xml异常Attempt to refer to a unregistered pool by its alias
- Attempt to refer to a unregistered pool by its alias 'dbpool'
- 余 某 宝 惨 败!
- 使用 FUSE 开发自己的文件系统
- sudo apt-get install software-center
- unity开发之五:UGUI界面规范以及素材命名规范
- How to use Ext4 如何使用EXT4
- Tensorflow ValueError: Attempt to reuse RNNCell with a different variable scope than its first
- LizardFS的安装使用
- webpack的配置(一)
- this的使用
- Python文件夹遍历
- Python 参数函数
- 《阿里巴巴Java开发手册》IDEA插件与Eclipse插件使用指南
- 字典序算法
- 阿里云服务器和云虚拟主机的区别是什么?新手站长买哪个更好?