module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell
See original GitHub issueCode 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'
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Tensorflow error in import tf.nn.rnn_cell - Stack Overflow
I faced with this error: AttributeError: module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell'. Finally, I replaced tf.nn.rnn_cell ...
Read more >tf.compat.v1.nn.rnn_cell.MultiRNNCell | TensorFlow v2.11.0
if cells is empty (not allowed), or at least one of the cells returns a state tuple but the flag state_is_tuple is False...
Read more >module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell'
TF2.1+Python3.6报错代码cell = tf.nn.rnn_cell.BasicRNNCell(num_units=128)报错信息AttributeError: module 'tensorflow_core._api.v2.nn' has no ...
Read more >module 'tensorflow_core._api.v2.nn' has no attribute 'rnn_cell ...
该问题是在tfv2环境下跑了tfv1的代码导致的,只需把v1的用法替换成v2留出的兼容用法即可: 用tf.compat.v1.nn.rnn_cell.RNNCell代替tf.nn.rnn_cell.R.
Read more >[Tensorflow] module 'tensorflow_core._api' has no attribute 'v2'
Finally, I'm trying use tensorflow_core api. import tensorflow_core as tf_core tf_core._api.v2.saved_model.load('model/trt_int8', tags=[trt.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@parikshit-ai I presume you meant its not working with 2.1.x?
If you found a solution, do keep us posted.
This code is not for tensorflow 2.x. tensorflow 2.x has many break changes.