Nmt: error when training the GNMT

Created on 15 Sep 2017  路  6Comments  路  Source: tensorflow/nmt

Hello, I want to train the GNMT for English-Chinese translation. I follow the example command for training the GNMT WMT German-English model, but there is an error:

Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/ec2-user/neural_machine_translation/nmt/nmt.py", line 28, in
from . import inference
File "nmt/inference.py", line 25, in
from . import attention_model
File "nmt/attention_model.py", line 22, in
from . import model
File "nmt/model.py", line 27, in
from . import model_helper
File "nmt/model_helper.py", line 9, in
from tensorflow.python.ops import lookup_ops
ImportError: cannot import name lookup_ops

I am running Tensorflow 1.1.0 with GPU support on Linux and it has been working fine for long.

Most helpful comment

I guess the NMT model needs Tensorflow 1.2+.

All 6 comments

I guess the NMT model needs Tensorflow 1.2+.

I have tensorflow 1.6 installed. Still, I get a similar error. Here is a screenshot.
Can you help me out?

tensor

I have the same problem, hope someone help us , maybe it is related to tensorflow version?

@Vab-jain Does remove the import and replace lookup_ops.index_to_string_table_from_file with tf.contrib.lookup.index_to_string_table_from_file works for you in tf 1.6?

@oahziur is right and you may need to do following replacement too:
tf.nn.rnn_ce.MultiRNNCell -> tf.contrib.rnn.MultiRNNCell
...

However, tf.data.TextLineDataset() is a new function from tf 1.4, so it seems impossible to use tf 1.1 to run this project.

which lines should be replace

Was this page helpful?
0 / 5 - 0 ratings