Nmt: Why did I download the source code and display the following error锛歠rom . import inference ImportError: cannot import name 'inference'

Created on 20 Sep 2017  路  3Comments  路  Source: tensorflow/nmt

Most helpful comment

you should run this command: python -m nmt.nmt --xxxxxxxx, instead python nmt/nmt.py

All 3 comments

you should run this command: python -m nmt.nmt --xxxxxxxx, instead python nmt/nmt.py

I also try this: python -m nmt.nmt --xxxxxxxx\
--src=vi --tgt=en \
--vocab_prefix=/tmp/nmt_data/vocab \
--train_prefix=/tmp/nmt_data/train \
--dev_prefix=/tmp/nmt_data/tst2012 \
--test_prefix=/tmp/nmt_data/tst2013 \
--out_dir=/tmp/nmt_model \
--num_train_steps=12000 \
--steps_per_stats=100 \
--num_layers=2 \
--num_units=128 \
--dropout=0.2 \
--metrics=bleu
But it gives Error as:
* from . import inference
ImportError: attempted relative import with no known parent package
*

From what location within the directory structure are you running this command? I encountered the same issue when I ran it one level too deep (in the 'nmt' directory). Try running it from the same directory where you find the README.md. That solved the problem for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdolHong picture AdolHong  路  3Comments

JBH168 picture JBH168  路  6Comments

JasonYCHuang picture JasonYCHuang  路  5Comments

ArmageddonKnight picture ArmageddonKnight  路  5Comments

janenie picture janenie  路  7Comments