我正在尝试运行教程(http://r2rt.com/recurrent-neural-networks-in-tensorflow-ii.html),并在移动的模块中存在一些问题。TensorFLow:tf.contrib.rnn模块对象不可调用
我研究了一下,发现部分课程已移动和固定的:
tf.nn.rnn_cell.BasicRNNCell(state_size)
到
tf.contrib.rnn.BasicRNNCell(state_size) (that should be correct right?)
这工作了。
不过,我有这个功能,我似乎无法修复:
rnn_outputs, final_state = tf.nn.rnn(cell, rnn_inputs, initial_state=init_state)
--> as expected, says: module 'tensorflow.python.ops.nn' has no attribute 'rnn'
所以,我想:
rnn_outputs, final_state = tf.contrib.rnn(cell, rnn_inputs, initial_state=init_state)
但是,上面写着: '模块' 对象不是可调用
我正在使用python3(尝试2以及),通过pip3安装了新的TensorFlow 1.0.0。
我试过看API,但对我来说没什么意义,因为我仍在阅读教程来试着了解发生了什么。我想可能这些论据已经改变了,或者现在可能是一个子功能? https://www.tensorflow.org/api_docs/python/tf/contrib/rnn
可能重复[TensorFLow r 1.0中rnn()的等价物是什么?](http://stackoverflow.com/questions/42497216/what-is-the-equivalent-of-the-rnn-in -tensorflow -r-1-0) –