Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'tensorflow.python.ops.rnn_cell_impl' has no attribute '_like_rnncell' #2

Closed
cy-dream opened this issue Jul 3, 2019 · 5 comments

Comments

@cy-dream
Copy link

cy-dream commented Jul 3, 2019

WARNING:tensorflow:From C:\Users\cydream\Desktop\AGPC-master\model\cell.py:12: BasicLSTMCell.init (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is deprecated, please use tf.nn.rnn_cell.LSTMCell, which supports all the feature this cell currently has. Please replace the existing code with tf.nn.rnn_cell.LSTMCell(name='basic_lstm_cell').
Traceback (most recent call last):
File "train_PCGN.py", line 174, in
main(config)
File "train_PCGN.py", line 79, in main
l2_regularize=l2_regularize, learning_rate=learning_rate, max_to_keep=max_checkpoints, max_gradient_norm=max_gradient_norm,
File "C:\Users\cydream\Desktop\AGPC-master\model\PCGN_model.py", line 89, in init
self.build_model()
File "C:\Users\cydream\Desktop\AGPC-master\model\PCGN_model.py", line 300, in build_model
name='PCGNWrapper')
File "C:\Users\cydream\Desktop\AGPC-master\model\PCGN_attention.py", line 152, in init
if not rnn_cell_impl._like_rnncell(cell): # pylint: disable=protected-access
AttributeError: module 'tensorflow.python.ops.rnn_cell_impl' has no attribute '_like_rnncell'

我装的tensorflow1.4 出现了这个错误

@Walleclipse
Copy link
Owner

Walleclipse commented Jul 4, 2019

你好, 不好意思 python 3.6 可能会报错。
我用 python 3.5 和 tensorflow-gpu==1.4 验证过了,可以正常运行。
你可能需要装 python 3.5 和 tensorflow-gpu 1.4。

@ethan-phu
Copy link

你好我也遇到这个问题了!为何会在3.6中报错呢?

@cookie54sun
Copy link

是因为tf版本问题还是python版本问题?tf 1.15也爆同样的错

@Walleclipse
Copy link
Owner

不好意思,具体原因我也不清楚。
但是只有在python 3.5 和 tensorflow-gpu==1.4 同时满足时下才可以正常运行。
这个代码比较老了,和新的python库不太兼容,但是在新的tensorflowPython版本里实现该代码的功能反而会更容易一点。

@xzhws
Copy link

xzhws commented May 4, 2021

不需要更改Python的版本,可以参考这种解决方式:sjvasquez/handwriting-synthesis#22 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants