Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF Flag, for mode is raising exception --mode="train" #93

Open
Adityagrao opened this issue May 20, 2018 · 4 comments
Open

TF Flag, for mode is raising exception --mode="train" #93

Adityagrao opened this issue May 20, 2018 · 4 comments

Comments

@Adityagrao
Copy link

python run_summarization.py --mode="train" --data_path="../misc/finished_files/chunked/train_*" --vocab_path="../misc/finished_files/vocab" --log_root="log/" --exp_name="first_test"
/home/ubuntu/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
/home/ubuntu/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py:1067: UserWarning: Duplicate key in file "/home/ubuntu/.config/matplotlib/matplotlibrc", line #2
  (fname, cnt))
/home/ubuntu/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py:1067: UserWarning: Duplicate key in file "/home/ubuntu/.config/matplotlib/matplotlibrc", line #3
  (fname, cnt))
Tensorflow Version  1.8.0
INFO:tensorflow:Starting seq2seq_attention in train mode...
Warning : Incorrectly formated line in vocab file : 0800 555 111 356


Warning : Incorrectly formated line in vocab file : 1800 333 000 139


Warning : Incorrectly formated line in vocab file : 2 1/2 124


Warning : Incorrectly formated line in vocab file : 3 1/2 86


max_size of vocab was specified as 50000; we now have 50000 words. Stopping reading.
Finished constructing vocabulary of 50000 total words. Last word added: farina
Traceback (most recent call last):
  File "run_summarization.py", line 305, in <module>
    tf.app.run()
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "run_summarization.py", line 301, in main
    raise ValueError("The 'mode' flag must be one of train/eval/decode")
ValueError: The 'mode' flag must be one of train/eval/decode

I tried manually passing inside the run() with argv.
I have tried passing it as command and string ie --mode=train and --mode="train"

Using
Python 3.6
Tensorlfow 1.8

@leobouscarrat
Copy link

Have you tried to print the type of the value you pass ?

@seungwonpark
Copy link

Try tensorflow version under 1.4.0. The hps API has changed around version 1.4~1.5, and this repository's code doesn't work after that.

@Rachnas
Copy link

Rachnas commented Jul 3, 2018

You need to see mode.value if you are running TF version > 1.4.

@seungwonpark
Copy link

@Adityagrao
Here you go. This code is executable with Tensorflow>=1.5.0.
https://github.com/seungwonpark/pointer-generator

@abisee
Would you mind listing this repository to "About this code" section of README.md, like:

Python 3, Tensorflow>=1.5.0 version: see @seungwonpark's fork

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants