Hi, I tried to evaluate result, ClassNotFoundException error raised.
How can I add SemgrexPattern class?
(magic) teang1995@devbox:~/codes/MAGIC/image_captioning/evaluation$ python cocoeval.py --result_file_path ../inference_result/flickr30k/baselines/contrastive_result.json
tokenization...
PTBTokenizer tokenized 72436 tokens at 390823.69 tokens per second.
PTBTokenizer tokenized 14999 tokens at 142902.49 tokens per second.
setting up scorers...
computing Bleu score...
{'testlen': 13000, 'reflen': 12470, 'guess': [13000, 12000, 11000, 10000], 'correct': [6192, 2110, 773, 341]}
ratio: 1.0425020048114642
Bleu_1: 0.476
Bleu_2: 0.289
Bleu_3: 0.181
Bleu_4: 0.119
computing METEOR score...
METEOR: 0.127
computing Rouge score...
ROUGE_L: 0.353
computing CIDEr score...
CIDEr: 0.089
computing SPICE score...
Exception in thread "main" java.lang.NoClassDefFoundError: edu/stanford/nlp/semgraph/semgrex/SemgrexPattern
at edu.anu.spice.SpiceParser.<clinit>(SpiceParser.java:64)
at edu.anu.spice.SpiceScorer.scoreBatch(SpiceScorer.java:70)
at edu.anu.spice.SpiceScorer.main(SpiceScorer.java:60)
Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.semgraph.semgrex.SemgrexPattern
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 3 more
Traceback (most recent call last):
File "cocoeval.py", line 16, in <module>
cocoEval.evaluate()
File "/home/teang1995/codes/MAGIC/image_captioning/evaluation/pycocoevalcap/eval.py", line 59, in evaluate
score, scores = scorer.compute_score(gts, res)
File "/home/teang1995/codes/MAGIC/image_captioning/evaluation/pycocoevalcap/spice/spice.py", line 69, in compute_score
subprocess.check_call(spice_cmd,
File "/data1/teang1995/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar', '/home/teang1995/codes/MAGIC/image_captioning/evaluation/pycocoevalcap/spice/tmp/tmpc2vzaamg', '-cache', '/home/teang1995/codes/MAGIC/image_captioning/evaluation/pycocoevalcap/spice/cache', '-out', '/home/teang1995/codes/MAGIC/image_captioning/evaluation/pycocoevalcap/spice/tmp/tmp1rq2qr4m', '-subset', '-silent']' returned non-zero exit status 1.