daniel-kukiela / nmt-chatbot

NMT Chatbot
GNU General Public License v3.0
387 stars 214 forks source link

AttributeError: module 'tensorflow._api.v2.nn' has no attribute 'rnn_cell' #163

Open arjunalwe opened 4 years ago

arjunalwe commented 4 years ago

Unsure why I'm facing this issue or how to solve it. I have tried to look it up, but it didn't turn up any answers that made sense. I haven't changed anything in settings.py, so nothing wrong there.

Here's the full error:

File "train.py", line 8, in from nmt import nmt File "C:\Users\arjun\PycharmProjects\Tensorflow\nmt-chatbot-master/nmt\nmt\nmt.py", line 28, in from . import inference File "C:\Users\arjun\PycharmProjects\Tensorflow\nmt-chatbot-master/nmt\nmt\inference.py", line 25, in from . import gnmt_model File "C:\Users\arjun\PycharmProjects\Tensorflow\nmt-chatbot-master/nmt\nmt\gnmt_model.py", line 261, in class GNMTAttentionMultiCell(tf.nn.rnn_cell.MultiRNNCell): AttributeError: module 'tensorflow._api.v2.nn' has no attribute 'rnn_cell'

FunniMonke commented 1 year ago

When tensorflow upgraded to version 2 they changed a lot of stuff. To fix this error just do this:

1) If you have anaconda then run conda create -n "yourenvhere" python=3.7

2) Run conda activate "yourenvhere"

3) run python --version to check if its 3.7

4) run pip install tensorflow-gpu==1.15

5) run train.py