Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell #466

Open
nashid opened this issue Apr 3, 2020 · 7 comments
Open

module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell #466

nashid opened this issue Apr 3, 2020 · 7 comments

Comments

@nashid
Copy link

nashid commented Apr 3, 2020

Code does not work with the latest Tensorflow library:

Traceback (most recent call last):
  File "/Users/XXXXX/opt/anaconda2/envs/XXXXXX/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/XXXXX/opt/anaconda2/envs/XXXXXX/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/XXXXX/Model/nmt/nmt.py", line 28, in <module>
    from . import inference
  File "/Users/XXXXX/Model/nmt/inference.py", line 25, in <module>
    from . import gnmt_model
  File "/Users/XXXXX/Model/nmt/gnmt_model.py", line 216, in <module>
    class GNMTAttentionMultiCell(tf.nn.rnn_cell.MultiRNNCell):
AttributeError: module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell'
@bjjoy
Copy link

bjjoy commented May 19, 2020

Code does not work with the latest Tensorflow library:

Traceback (most recent call last):
  File "/Users/XXXXX/opt/anaconda2/envs/XXXXXX/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/XXXXX/opt/anaconda2/envs/XXXXXX/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/XXXXX/Model/nmt/nmt.py", line 28, in <module>
    from . import inference
  File "/Users/XXXXX/Model/nmt/inference.py", line 25, in <module>
    from . import gnmt_model
  File "/Users/XXXXX/Model/nmt/gnmt_model.py", line 216, in <module>
    class GNMTAttentionMultiCell(tf.nn.rnn_cell.MultiRNNCell):
AttributeError: module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell'

I have the same problem in tf 2.2.0. I change tf version to 1.14,problem has been solved

@nashid
Copy link
Author

nashid commented May 19, 2020

@bjjoy so you have to install tensorflow 1.14?

I tried with tensorflow 1.5 which worked fine as well.

@parikshit-ai
Copy link

parikshit-ai commented May 25, 2020

Its not working with 2.1.x, I am using rasa which requires >=2.1 & <2.2 so can anyone tell me what is the concrete solution??

@nashid
Copy link
Author

nashid commented May 25, 2020

@parikshit-ai I presume you meant its not working with 2.1.x?

If you found a solution, do keep us posted.

@bjjoy
Copy link

bjjoy commented May 26, 2020

@bjjoy so you have to install tensorflow 1.14?

I tried with tensorflow 1.5 which worked fine as well.

It should be 1.14==1.4. pip list to show tf version 1.14

@luozhouyang
Copy link

This code is not for tensorflow 2.x. tensorflow 2.x has many break changes.

@ArashHosseini
Copy link

ArashHosseini commented May 30, 2022

@nashid you can use it with nvidia tf. i am using without any problem.

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

No branches or pull requests

5 participants