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

ImportError: cannot import name '_like_rnncell' #22

Open
ssell opened this issue Oct 18, 2018 · 8 comments
Open

ImportError: cannot import name '_like_rnncell' #22

ssell opened this issue Oct 18, 2018 · 8 comments

Comments

@ssell
Copy link

ssell commented Oct 18, 2018

System:

  • Windows 10 1803
  • Python 3.6.2
  • TensorFlow 1.11.0

Error:

Traceback (most recent call last):
File "test.py", line 1, in <module>
    import demo
File "C:\Projects\ml\handwriting-synthesis\demo.py", line 9, in <module>
    from rnn import rnn
File "C:\Projects\ml\handwriting-synthesis\rnn.py", line 10, in <module>
    from rnn_ops import rnn_free_run
File "C:\Projects\ml\handwriting-synthesis\rnn_ops.py", line 9, in <module>
    from tensorflow.python.ops.rnn_cell_impl import _concat, _like_rnncell
ImportError: cannot import name '_like_rnncell'

Solution:

Hacky, but I simply removed the reference to _like_rnncell on lines 9, 29, and 30 in rnn_ops.py. Seems to run fine afterwards (though this led to encountering Issue #17).

@Jertlok
Copy link

Jertlok commented Jun 29, 2019

_like_rnncell has been deprecated as of TensorFlow version 1.0+

Use rnn_cell_impl.assert_like_rnncell instead of _like_rnncell.
Check this for reference.

@mzw2018
Copy link

mzw2018 commented Oct 23, 2019

best method is make tehsorflow version is 1.6.0, if not there will be many issues.

@docongminh
Copy link

@ssell I think you need to install and use the tensorflow version 1.6.0. otherwise you cannot fix this problem thoroughly
reference for install tensorflow 1.6.0: https://stackoverflow.com/questions/38896424/tensorflow-not-found-using-pip

@samvatsar
Copy link

@docongminh, Looks like we can indeed use the latest version of tensorflow with a few changes to the rnn_ops.py file. Please refer to Support the latest tensorflow #27 pull request for more info.

@swainsubrat
Copy link

@docongminh How do I do that. I'm not getting it.

@samvatsar
Copy link

@docongminh How do I do that. I'm not getting it.

Please make changes to your files as per the changes made in #27 (go to files changed tab).

@WindowsNT
Copy link

I tried to emulate your setup and I still have the error:

Python 3.6.2
TensorFlow 1.11.0

AttributeError: module 'tensorflow.compat' has no attribute 'v1'

@abhiprojectz
Copy link

Instead of doing much changes in the core project.

Just use this ==> from tensorflow.python.ops.rnn_cell_impl import assert_like_rnncell as _like_rnncell

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

8 participants