fengyang0317 / unsupervised_captioning

Code for Unsupervised Image Captioning
MIT License
215 stars 51 forks source link

Input to vocabulary.py in im2txt folder #5

Closed eshwarhs closed 5 years ago

eshwarhs commented 5 years ago

What should the input file to vocabulary.py look like? I have generated a file with a list of words in a file named "word_counts.txt" and I'm passing this to vocabulary object.

The line vocab = vocabulary.Vocabulary(word_counts.txt) is giving me an error I'm not able to figure out: assert start_word in reverse_vocab AssertionError

word_counts.txt Here's the slightly modified code cap

Someone help me out.

fengyang0317 commented 5 years ago

\<S> must be in your word_count.txt file.

https://github.com/fengyang0317/unsupervised_captioning/blob/master/data/word_counts.txt is an example.