lukemelas / image-paragraph-captioning

[EMNLP 2018] Training for Diversity in Image Paragraph Captioning
91 stars 23 forks source link

Problem with Pre-trained model #7

Closed sabirdvd closed 5 months ago

sabirdvd commented 5 years ago

Hey luke, Thank you very much for sharing your work.

I'm trying to do some experiment with the uploaded pretrained model, to do some inference, But the pre-trained model is just generating a UNK word.

I used this flags python eval.py --model data/model-best-i84000-score0.314696218186.pth --infos_path data/for_zip/infos_-best.pkl --image_folder data/image

unk

Also, the eval_utils.py have the same problem with (https://github.com/ruotianluo/self-critical.pytorch/issues/42 with KeyError: 'att_masks' ) I found a solution from this link, would be great to update the file with this modified code https://github.com/ruotianluo/self-critical.pytorch/issues/42

tmp = [data['fc_feats'][np.arange(loader.batch_size) * loader.seq_per_img], data['att_feats'][np.arange(loader.batch_size) * loader.seq_per_img], data['att_masks'][np.arange(loader.batch_size) * loader.seq_per_img] if 'att_masks' in data is not None else None]

Again, Thank you for sharing your work

pidugusundeep commented 5 years ago

@sabirdvd Even i get 'UNK' like the same as you have, is that problem with the trained model ??

cczka commented 4 years ago

got the same problem, is there any solution?