Skip to content

ClassNotFoundException: edu.stanford.nlp.sempre.sketch.UnarySketchFn #14

@therealansh

Description

@therealansh

Hey, so i was looking at the source and tried

python3 synthesize_benchmark.py

but it happens to run into an error in Sempre indicating that there is some class missing.
However Docker image runs fine and produces the sketches. But i need to run it on local.

main() {
  Grammar.readjava.lang.RuntimeException: java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.sketch.UnarySketchFn
        at fig.basic.Utils.newInstanceHard(Utils.java:270)
        at edu.stanford.nlp.sempre.Grammar.parseSemanticFn(Grammar.java:555)
        at edu.stanford.nlp.sempre.Grammar.interpretRule(Grammar.java:299)
        at edu.stanford.nlp.sempre.Grammar.interpret(Grammar.java:183)
        at edu.stanford.nlp.sempre.Grammar.readOnePath(Grammar.java:157)
        at edu.stanford.nlp.sempre.Grammar.read(Grammar.java:66)
        at edu.stanford.nlp.sempre.Grammar.read(Grammar.java:58)
        at edu.stanford.nlp.sempre.Builder.buildUnspecified(Builder.java:45)
        at edu.stanford.nlp.sempre.Builder.build(Builder.java:38)
        at regex.TestDemo.run(TestDemo.java:144)
        at fig.exec.Execution.runWithObjArray(Execution.java:337)
        at fig.exec.Execution.run(Execution.java:325)
        at regex.TestDemo.main(TestDemo.java:184)
Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.sketch.UnarySketchFn
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:375)
        at fig.basic.Utils.newInstanceHard(Utils.java:268)
        ... 12 more
 {
    ERROR: java.lang.RuntimeException: Error on (rule $SKETCH ($LIST_PROGRAM) (sketch.UnarySketchFn)): java.lang.RuntimeException: java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.sketch.UnarySketchFn:
edu.stanford.nlp.sempre.Grammar.interpret(Grammar.java:205)
edu.stanford.nlp.sempre.Grammar.readOnePath(Grammar.java:157)
edu.stanford.nlp.sempre.Grammar.read(Grammar.java:66)
edu.stanford.nlp.sempre.Grammar.read(Grammar.java:58)
edu.stanford.nlp.sempre.Builder.buildUnspecified(Builder.java:45)
edu.stanford.nlp.sempre.Builder.build(Builder.java:38)
regex.TestDemo.run(TestDemo.java:144)
fig.exec.Execution.runWithObjArray(Execution.java:337)
fig.exec.Execution.run(Execution.java:325)
regex.TestDemo.main(TestDemo.java:184)
1 errors, 0 warnings
  }
Traceback (most recent call last):
  File "py_scripts/test.py", line 41, in <module>
    main()
  File "py_scripts/test.py", line 38, in main
    test(args)
  File "py_scripts/test.py", line 30, in test
    make_sketch_file(pred_file, output_dir, args.dataset, args.topk)
  File "sempre/py_scripts/postprocess.py", line 201, in make_sketch_file
    with open(pred_file) as f:
FileNotFoundError: [Errno 2] No such file or directory: './regex/data/_tmp/200-pred-test.txt'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions