utopia-group / regel

REGEL: Regular Expression Generation from Examples and Language
MIT License
33 stars 9 forks source link

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

Open therealansh opened 2 years ago

therealansh commented 2 years ago

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'
therealansh commented 2 years ago

Also Sempre builds for the first time with an error

error: package org.omg.PortableInterceptor does not exist

but this is solved by removing it since it isn't used anywhere in the file. After this error is resolved I run into the above error of ClassNotFound as I stated above.

thelyad commented 2 years ago

@xiye17 According to the sempre author this class "java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.sketch.UnarySketchFn" is a regel-specific class. Could you look into this when available? Thanks!