tylin / coco-caption

Other
1.14k stars 545 forks source link

Error while using coco-caption to evaluate #36

Open MozhdehDokhani opened 6 years ago

MozhdehDokhani commented 6 years ago

Hi, I tried to use coco caption to evaluate my neuraltalk2 results. but this error occured:

Loading and preparing results... Traceback (most recent call last): File "myeval.py", line 29, in <module> cocoRes = coco.loadRes(resFile) File "/home/mozhdeh/Documents/neuraltalk2-master/coco-caption/pycocotools/coco.py", line 318, in loadRes if 'caption' in anns[0]: IndexError: list index out of range /home/mozhdeh/torch/install/bin/luajit: ./misc/utils.lua:17: attempt to index local 'file' (a nil value) stack traceback: ./misc/utils.lua:17: in function 'read_json' ./misc/net_utils.lua:202: in function 'language_eval' eval.lua:167: in function 'eval_split' eval.lua:173: in main chunk [C]: in function 'dofile' ...hdeh/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x55cbcb3e8570

Any solution?

mymuli commented 5 years ago

I had the same problem and tried to solve it with Python 3, but it was still wrong....

mymuli commented 5 years ago

我知道怎么解决了.... 在eval阶段,设置命令-language_eval 0....如果-language_eval 1, 会报错: if 'caption' in anns[0]: IndexError: list index out of range

BetterZhouXu commented 5 years ago

我知道怎么解决了.... 在eval阶段,设置命令-language_eval 0....如果-language_eval 1, 会报错: if 'caption' in anns[0]: IndexError: list index out of range

你好啊,你是在本地测评的还是在线测评的?没太看懂这个错误是怎么生成的,没有language_eval参数啊,并且我看我生成的结果是按照{'image_id': 123, 'caption': xxx xxx xxx}排成了列表, 结果和你一样的错误

Sun-WeiZhen commented 4 years ago

我知道怎么解决了.... 在eval阶段,设置命令-language_eval 0....如果-language_eval 1, 会报错: if 'caption' in anns[0]: IndexError: list index out of range

你好!在eval阶段,resFile一直是None,请问怎样解决这个问题?谢谢! Loading and preparing results...
Traceback (most recent call last): File "G:/graph attention/SCA-image_captioning/evaluate.py", line 32, in cocoRes = coco.loadRes(resFile) File "G:\graph attention\SCA-image_captioning\pycocotools\coco.py", line 280, in loadRes anns = json.load(open(resFile)) TypeError: expected str, bytes or os.PathLike object, not NoneType