microth / PathLSTM

Neural SRL model
71 stars 14 forks source link

Error running FrameNet model: java.io.InvalidObjectException: #10

Closed ebronstein closed 7 years ago

ebronstein commented 7 years ago

I tried running the scripts/parse.sh script using the FrameNet model (srl-ICCG16-eng.model), but I got the error: java.io.InvalidObjectException: enum constant PathEmbeddingacN_FNET_seed3 does not exist in class uk.ac.ed.inf.srl.features.FeatureName. The other model (srl-ACL2016-eng.model) works fine, but the FrameNet model does not. I have SRL_MODEL=models/srl-ICCG16-eng.model in scripts/parse.sh and the FrameNet data in models/fndata-1.5/. I'm not sure where I should specify where the FrameNet data is though, or if I need to do that at all. Could the problem be that I didn't add something to the classpath? I haven't added anything because the other model worked fine without it.

Here is the stacktrace:

scripts/parse.sh tests/testParse1In.txt 54.53.188 is2.data.ParametersFloat 121:read -> read parameters 134217727 not zero 296071 54.53.196 is2.data.Cluster 113: -> Read cluster with 0 words 54.53.196 is2.lemmatizer.Lemmatizer 192:readModel -> Loading data finished. 54.53.197 is2.lemmatizer.Lemmatizer 194:readModel -> number of params 134217727 54.53.197 is2.lemmatizer.Lemmatizer 195:readModel -> number of classes 92 54.59.358 is2.data.ParametersFloat 121:read -> read parameters 134217727 not zero 1613201 54.59.359 is2.data.Cluster 113: -> Read cluster with 0 words 54.59.362 is2.tag.Lexicon 103: -> Read lexicon with 0 words 54.59.364 is2.tag.Tagger 141:readModel -> Loading data finished. 54.59.391 is2.parser.Parser 188:readModel -> Reading data started 54.59.431 is2.data.Cluster 113: -> Read cluster with 0 words 55.6.812 is2.parser.ParametersFloat 101:read -> read parameters 134217727 not zero 19957525 55.6.814 is2.parser.Parser 201:readModel -> parsing -- li size 134217727 55.6.826 is2.parser.Parser 211:readModel -> Stacking false 55.6.827 is2.parser.Extractor 56:initStat -> mult (d4) Used parser class is2.parser.Parser Creation date 2012.11.02 14:33:53 Training data CoNLL2009-ST-English-ALL.txt.crossannotated Iterations 10 Used sentences 10000000 Cluster null 55.6.830 is2.parser.Parser 240:readModel -> Reading data finnished 55.6.831 is2.parser.Extractor 56:initStat -> mult (d4) Loading pipeline from models/srl-ICCG16-eng.model java.io.InvalidObjectException: enum constant PathEmbeddingacN_FNET_seed3 does not exist in class uk.ac.ed.inf.srl.features.FeatureName at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1746) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) at java.util.HashMap.readObject(HashMap.java:1394) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1900) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) at se.lth.cs.srl.pipeline.Pipeline.fromZipFile(Pipeline.java:192) at se.lth.cs.srl.pipeline.Pipeline.fromZipFile(Pipeline.java:226) at se.lth.cs.srl.pipeline.Reranker.(Reranker.java:63) at se.lth.cs.srl.CompletePipeline.getCompletePipeline(CompletePipeline.java:52) at se.lth.cs.srl.CompletePipeline.main(CompletePipeline.java:122) Caused by: java.lang.IllegalArgumentException: No enum constant uk.ac.ed.inf.srl.features.FeatureName.PathEmbeddingacN_FNET_seed3 at java.lang.Enum.valueOf(Enum.java:238) at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1743) ... 21 more Writing corpus to out.txt... Exception in thread "main" java.lang.NullPointerException at se.lth.cs.srl.pipeline.Reranker.parse(Reranker.java:96) at se.lth.cs.srl.SemanticRoleLabeler.parseSentence(SemanticRoleLabeler.java:12) at se.lth.cs.srl.CompletePipeline.parseX(CompletePipeline.java:93) at se.lth.cs.srl.CompletePipeline.parse(CompletePipeline.java:73) at se.lth.cs.srl.CompletePipeline.parseNonSegmentedLineByLine(CompletePipeline.java:165) at se.lth.cs.srl.CompletePipeline.main(CompletePipeline.java:138)

microth commented 7 years ago

Hi Eli,

Sorry, that's entirely my fault. The FeatureName class in the default branch is outdated. Please replace it with the following file from the master branch: https://github.com/microth/PathLSTM/blob/master/src/main/java/uk/ac/ed/inf/srl/features/FeatureName.java

You might need other updated classes from that branch as well, so feel free to check out all of them. (But you might have to replace some of them again because of added dependencies that are not publicly available.)

The path to the FrameNet data is specified by a command line parameter ("-framenet")

Cheers, Michael

mosynaq commented 7 years ago

Hi @ebronstein . Can you share your edited/working files/folder with me? I am having the same problem but the solution mentioned above did not help or is not complete. thx!

microth commented 7 years ago

I integrated all changes into the default branch. So this issue should be fixed now. Sorry for the delay everyone.