- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我运行了 Tensorflow 1.0 提供的 ptb_word_lm.py
,但它显示了这条消息:
ValueError: Attempt to have a second RNNCell use the weights of a variable scope that already has weights: 'Model/RNN/multi_rnn_cell/cell_0/basic_lstm_cell'; and the cell was not constructed as BasicLSTMCell(..., reuse=True). To share the weights of an RNNCell, simply reuse it in your second calculation, or create a new one with the argument reuse=True.
然后我修改代码,将'reuse=True'
添加到BasicLSTMCell
,但它显示了这条消息:
ValueError: Variable Model/RNN/multi_rnn_cell/cell_0/basic_lstm_cell/weights does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?
我该如何解决这个问题?
最佳答案
将 reuse = tf.get_variable_scope().reuse
添加到 BasicLSTMCell 对我来说没问题。
关于python - 值错误 : Attempt to have a second RNNCell use the weights of a variable scope that already has weights,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43060827/
我是一名优秀的程序员,十分优秀!