Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while using coco-caption to evaluate #36

Open
MozhdehDokhani opened this issue Nov 22, 2018 · 4 comments
Open

Error while using coco-caption to evaluate #36

MozhdehDokhani opened this issue Nov 22, 2018 · 4 comments

Comments

@MozhdehDokhani
Copy link

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
Copy link

mymuli commented Apr 14, 2019

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

@mymuli
Copy link

mymuli commented Apr 14, 2019

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

@BetterZhouXu
Copy link

我知道怎么解决了.... 在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
Copy link

我知道怎么解决了.... 在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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants