llSourcell / tensorflow_chatbot

Tensorflow chatbot demo by @Sirajology on Youtube
1.45k stars 807 forks source link

No module named models.rnn.translate #26

Open AnupKumarGupta opened 7 years ago

AnupKumarGupta commented 7 years ago

Traceback (most recent call last): File "execute.py", line 31, in import seq2seq_model File "tensorflow_chatbot/seq2seq_model.py", line 28, in from tensorflow.models.rnn.translate import data_utils ImportError: No module named models.rnn.translate

Graystripe17 commented 7 years ago

Use TensorFlow 0.12.0 instead of TensorFlow 1.0.0

RathanakSreang commented 7 years ago

@Graystripe17 do you have other solution beside using old version?

Graystripe17 commented 7 years ago

@RathanakSreang if you try to go in and change the import a dozen of other changes spring up. If you want to use the latest version, wait for TF1.1 because I messaged some of the workers at TF and they promised to move the modules back

chrismpalmer commented 7 years ago

Friends! I am running 0.12.0 and getting this same problem. I appear to have the right config. I am using the tensorflow docker 0.12.0 so everything should be intact perhaps its built on a release candidate.

Graystripe17 commented 7 years ago

@chrismpalmer You using python 2.7?

chrismpalmer commented 7 years ago

@Graystripe17 yes

root@5d8738fee03e:/notebooks# python --version Python 2.7.6

Graystripe17 commented 7 years ago

@chrismpalmer I'm sorry I don't really have a good solution for you. If it's the exact same installation, I don't think it should be giving you this particular error. I used virtualenv and am not familiar with docker. Maybe give that a shot?

chrismpalmer commented 7 years ago

@Graystripe17 thanks a lot. I do notice there is a local data_utils and seq2seq_model imports a tensor flow one. I wonder if this is intended.

chrismpalmer commented 7 years ago

@Graystripe17 That was the problem. I am training now.

So if anyone else comes accross this. I fixed it by changing seq2seq_model to

import data_utils instead of the tensor flow one.

ImGokulM commented 7 years ago

I'm also getting the same error,

Traceback (most recent call last): File "execute.py", line 31, in import seq2seq_model File "\tensorflow_chatbot-master\seq2seq_model.py", line 28, in from tensorflow.models.rnn.translate import data_utils ImportError: No module named 'tensorflow.models'

Please help if anyone fixed this.

ImGokulM commented 7 years ago

Worked! As @Graystripe17 said, in seq2seq_model.py you need to replace the line #28 'from tensorflow.models.rnn.translate import data_utils' with 'import data_utils'. Thanks @Graystripe17!

Graystripe17 commented 7 years ago

@ImGokulM @chrismpalmer No problem! @AnupKumarGupta If this solved your issue, you can close this.

athuldevin commented 7 years ago

i have the same issue and i applied the fix it works ,but it throws another error for both train and test

Mode : test

Traceback (most recent call last): File "C:\Users\win-7\Downloads\Compressed\tensorflow_chatbot-master\execute.py", line 322, in decode() File "C:\Users\win-7\Downloads\Compressed\tensorflow_chatbot-master\execute.py", line 211, in decode model = create_model(sess, True) File "C:\Users\win-7\Downloads\Compressed\tensorflow_chatbot-master\execute.py", line 104, in create_model model = seq2seq_model.Seq2SeqModel( gConfig['enc_vocab_size'], gConfig['dec_vocab_size'], _buckets, gConfig['layer_size'], gConfig['num_layers'], gConfig['max_gradient_norm'], gConfig['batch_size'], gConfig['learning_rate'], gConfig['learning_rate_decay_factor'], forward_only=forward_only) File "C:\Users\win-7\Downloads\Compressed\tensorflow_chatbot-master\seq2seq_model.py", line 98, in init single_cell = tf.nn.rnn_cell.GRUCell(size) AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'rnn_cell'

roveneliah commented 7 years ago

I'm getting the same thing as @athuldevin after fixing line 28. Any ideas on what this could possibly be?

jmoney4769 commented 7 years ago

See https://github.com/llSourcell/tensorflow_chatbot/issues/46 on how to get it working with 1.2. Also the Tensorflow release notes talk about where packages get moved to.

LockGit commented 7 years ago

I'm getting the same thing as @AnupKumarGupta . use tensorflow docker container Python 2.7.12

sujeet1747 commented 7 years ago

You can uninstall using the following shell script_ sudo pip uninstall tensorflow and roll back by __ sudo pip install tensorflow==0.12

sujeet1747 commented 7 years ago

The conversation were gibberish. One I'd like to mention

Where are you ? orgy orgy orgy orgy orgy orgy orgy orgy orgy orgy orgy orgy

Where is the error, folks ?

LockGit commented 7 years ago

thx

ynakashio commented 6 years ago

I'm getting the same problem....