tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.35k stars 1.96k forks source link

ValueError: Attempted relative import in non-package #460

Open sweekarsud opened 4 years ago

sweekarsud commented 4 years ago

When I try running my nmt_code.sh which contains:

python -m nmt.nmt \ --vocab_prefix=$path_file/nmt_data_new/ \ --train_prefix=$path_file/nmt_data_new/ \ --dev_prefix=$path_file/tmp/nmt_data/ \ --test_prefix=$path_file/tmp/nmt_data/ \ --out_dir=$path_file/model_dir/ \ --num_train_steps=17000 \ --steps_per_stats=100 \ --num_layers=1 \ --num_units=64 \ --dropout=0.2 \ --metrics=bleu \ --cel_type=lstm \ --src=formal \ --tgt=en \ --attention=bahdanau \ --learning_rate=0.1

When I run this code as ./nmt_code.sh then I get the following error:

./nmt_code.sh Traceback (most recent call last): File "/export/home/myid/anaconda3/my_envs/py27/lib/python2.7/runpy.py", line 163, in _run_module_as_main mod_name, _Error) File "/export/home/myid/anaconda3/my_envs/py27/lib/python2.7/runpy.py", line 102, in _get_module_details loader = get_loader(mod_name) File "/export/home/myid/anaconda3/my_envs/py27/lib/python2.7/pkgutil.py", line 462, in get_loader return find_loader(fullname) File "/export/home/myid/anaconda3/my_envs/py27/lib/python2.7/pkgutil.py", line 472, in find_loader for importer in iter_importers(fullname): File "/export/home/myid/anaconda3/my_envs/py27/lib/python2.7/pkgutil.py", line 428, in iter_importers import(pkg) File "nmt.py", line 28, in from . import inference ValueError: Attempted relative import in non-package

jxhhdx commented 4 years ago

Have you solved it? I'm in the same situation