Pretrained-Show-and-Tell-model
Pretrained-Show-and-Tell-model copied to clipboard
unable to run
I'm getting following error
ankush@Lenovo:/media/Study/Projects/showandtell/models/im2txt$ bazel-bin/im2txt/run_inference --checkpoint_path=${CHECKPOINT_PATH} --vocab_file=${VOCAB_FILE} --input_files=${IMAGE_FILE}
INFO:tensorflow:Building model.
INFO:tensorflow:Initializing vocabulary from file:
Traceback (most recent call last):
File "/media/ankush/Study/Projects/showandtell/models/im2txt/bazel-bin/im2txt/run_inference.runfiles/im2txt/im2txt/run_inference.py", line 85, in
@ankush-06
Where did you place the checkpoint files?
Can you run ls -l --block-size=K
in your Pretrained-Show-and-Tell-model
folder?
Also, please share the full error log. It seems to have been truncated here.
Thanks for replying so soon. This is the result i got. Here are some screenshots. https://image.ibb.co/mfGza5/1.png https://image.ibb.co/da0E8Q/2.png
ankush@Lenovo:/media/ankush/Study/Projects/showandtell/models/im2txt/Pretrained-Show-and-Tell-model$ ls -l --block-size=K total 297528K drwxrwxrwx 1 ankush ankush 0K Jun 20 05:56 extras -rwxrwxrwx 1 ankush ankush 6334K Oct 1 2016 image.jpg -rwxrwxrwx 1 ankush ankush 2K Jun 20 05:56 LICENSE -rwxrwxrwx 1 ankush ankush 145511K Jun 20 10:24 model.ckpt-1000000.data-00000-of-00001 -rwxrwxrwx 1 ankush ankush 17K Jun 20 05:56 model.ckpt-1000000.index -rwxrwxrwx 1 ankush ankush 145511K Jun 20 05:55 model.ckpt-2000000.data-00000-of-00001 -rwxrwxrwx 1 ankush ankush 17K Jun 20 05:56 model.ckpt-2000000.index -rwxrwxrwx 1 ankush ankush 4K Jun 20 05:56 README.md -rwxrwxrwx 1 ankush ankush 120K Jun 20 10:48 word_counts.txt
This seems to be okay. Can you share your full error log (the previous one was truncated)? Which tensorflow version are you using?
I'm using ubuntu 16.04, python 2, tensorflow 1.2.0 Here is a screenshot of the error
https://image.ibb.co/dvSY2k/3.png
Seems like there's an issue with the word vocabulary. Are you using the word_counts.txt file given here?
Run cat word_counts.txt | head
.
https://image.ibb.co/hc6Ahk/4.png ashish@Ashish-Lenovo:/media/ashish/Study/Academics/BTP/Projects/showandtell/models/im2txt/Pretrained-Show-and-Tell-model$ cat word_counts.txt | head a 969108 <S> 586368 </S> 586368 . 440479 on 213612 of 202290 the 196219 in 182598 with 152984 and 139109
I think i'm not able to load "word_counts.txt" file properly because when i tried to print reverse_vocab it gave me an empty list.
i solved the problem, but results are not accurate. Any suggestions to improve performance ?
Can you try the 1M like mentioned here? Keep us updated on that thread. :smile: Closing this issue because it's solved.
Update: @ankush-06 Can you let us know how you solved it? Would love to document it. (Reopened until then)
To be really honest, i could'n really solved that issue :) but i somewhat overcame that. The problem was that the program was not able to locate the "word_counts.txt" file. I tried everything. I was getting frustated. So, i ran the commands in a separate python file("xxx.py"):
with tf.gfile.GFile("word_counts.txt") as f: word_map = list(f.readlines()) word_map = [line.split()[0] for line in word_map]
then i imported this word_map list in the vocabulary.py file. from xxx import word_map reverse_vocab = word_map
Also i had to install tensorflow==1.0 version. In versions > 1.0, i was having problems.
@ankush-06 how to solve it. I also encountered the same problem. Can teach me how to solve it?
I also encountered the same problem.