add global tf.FLAGS variable to data.py by blanche · Pull Request #8 · abisee/pointer-generator · GitHub
Skip to content

add global tf.FLAGS variable to data.py#8

Closed
blanche wants to merge 1 commit into
abisee:masterfrom
blanche:master
Closed

add global tf.FLAGS variable to data.py#8
blanche wants to merge 1 commit into
abisee:masterfrom
blanche:master

Conversation

@blanche

@blanche blanche commented May 12, 2017

Copy link
Copy Markdown

FLAGS is undefined in data.py
when running in decode mode and when a term is out of vocabulary, this will cause a NameError

  File "pointer-generator/data.py", line 198, in outputids2words
    assert FLAGS.pointer_gen, "Error: model produced a word ID that isn't in the vocabulary"
NameError: global name 'FLAGS' is not defined

in

    try:
      w = vocab.id2word(i) # might be [UNK]
    except ValueError as e: # w is OOV
      assert FLAGS.pointer_gen, "Error: model produced a word ID that isn't in the vocabulary"

This PR adds the global FLAGS variable to data.py

@abisee

abisee commented May 12, 2017

Copy link
Copy Markdown
Owner

@abisee abisee closed this May 15, 2017
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

Successfully merging this pull request may close these issues.

2 participants