abisee / pointer-generator

Code for the ACL 2017 paper "Get To The Point: Summarization with Pointer-Generator Networks"
Other
2.18k stars 812 forks source link

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

Open Adityagrao opened 6 years ago

Adityagrao commented 6 years ago

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 commented 6 years ago

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

seungwonpark commented 6 years ago

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 commented 6 years ago

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

seungwonpark commented 6 years ago

@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.