ImageCaptioning.pytorch icon indicating copy to clipboard operation
ImageCaptioning.pytorch copied to clipboard

about flickr8k dataset

Open ydyrx-ldm opened this issue 3 years ago • 3 comments

您好,我使用了flickr8k训练,也是可以完成成功地进行训练。但在最后的eval阶段出现了以下错误:

image 7989: a man in a black shirt is riding a rope image 7990: a group of football players in red uniforms in the field image 7991: a brown and white dog is running through the snow image 7992: a skateboarder jumps off a wall image 7993: two men playing soccer image 7994: a brown dog is running in the grass image 7995: a woman in a pink shirt is standing on a wall image 7996: two boys are playing in the water image 7997: a basketball player in a white uniform is playing basketball image 7998: a man in a pink shirt is holding her head image 7999: a black and white dog jumps to catch a tennis ball evaluating validation preformance... 1000/1000 (0.000000)

Traceback (most recent call last): File "tools/eval.py", line 117, in vars(opt)) File "/home/yuanling/ImageCaptioning.pytorch-master/captioning/utils/eval_utils.py", line 222, in eval_split lang_stats = language_eval(dataset, predictions, n_predictions, eval_kwargs, split) File "/home/yuanling/ImageCaptioning.pytorch-master/captioning/utils/eval_utils.py", line 74, in language_eval coco = getCOCO(dataset) File "/home/yuanling/ImageCaptioning.pytorch-master/captioning/utils/eval_utils.py", line 44, in getCOCO return COCO(annFile) UnboundLocalError: local variable 'annFile' referenced before assignment

不知哪里出错?我的训练是能完成的。

ydyrx-ldm avatar Oct 10 '21 14:10 ydyrx-ldm

因为没有生成对应的evaluation code用的annfile,看这里https://github.com/ruotianluo/ImageCaptioning.pytorch/blob/master/captioning/utils/eval_utils.py#L42

ruotianluo avatar Oct 10 '21 17:10 ruotianluo

你要自己家一行

ruotianluo avatar Oct 10 '21 17:10 ruotianluo

好的,我懂了,谢谢

ydyrx-ldm avatar Oct 11 '21 04:10 ydyrx-ldm