Skip to content

Semgrex Class Not Found Exception #42

@shaunakjoshi12

Description

@shaunakjoshi12

Even after installing Stanford Core NLP 3.9.2 and pasting the core and the models.jar files in lib,further adding all the jars of core-nlp folder into the CLASSPATH the following issue comes

Exception in thread "main" java.lang.NoClassDefFoundError: edu/stanford/nlp/semgraph/semgrex/SemgrexPattern
at edu.anu.spice.SpiceParser.(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:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Traceback (most recent call last):
File "test_results.py", line 50, in
metrics_dict = nlgeval.compute_metrics(references, hypotheses)
File "/home/shaunak/ProjectSSSP/FULL_S/caption_generator_resnet/nlg_eval_master/nlgeval/init.py", line 299, in compute_metrics
score, scores = scorer.compute_score(refs, hyps)
File "/home/shaunak/ProjectSSSP/FULL_S/caption_generator_resnet/nlg_eval_master/nlgeval/pycocoevalcap/spice/spice.py", line 70, in compute_score
cwd=os.path.dirname(os.path.abspath(file)))
File "/home/shaunak/anaconda2/lib/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar', '/home/shaunak/ProjectSSSP/FULL_S/caption_generator_resnet/nlg_eval_master/nlgeval/pycocoevalcap/spice/tmp/tmpVBAF4B', '-cache', '/home/shaunak/ProjectSSSP/FULL_S/caption_generator_resnet/nlg_eval_master/nlgeval/pycocoevalcap/spice/cache', '-out', '/home/shaunak/ProjectSSSP/FULL_S/caption_generator_resnet/nlg_eval_master/nlgeval/pycocoevalcap/spice/tmp/tmpp_GQD4', '-subset', '-silent']' returned non-zero exit status 1
python2 -W ignore test_results.py 26.40s user 0.85s system 193% cpu 14.052 total

Tried this with java 8 and java 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions