berkeley-entity
berkeley-entity copied to clipboard
File not found problem with model file
Hi Greg, I compiled the source files again and created berkeley-entity jar in target directory. Jar creation is successful. But while running the system with this jar I am getting the following error. Please help.
ERROR: java.lang.RuntimeException: Can't write to models/cached/corefpruner-onto.ser.gz: edu.berkeley.nlp.entity.GUtil$.save(GUtil.scala:28) edu.berkeley.nlp.entity.coref.CorefPruner$.trainAndSaveKFoldModels(CorefPruner.scala:103) edu.berkeley.nlp.entity.coref.CorefPruner$.buildPruner(CorefPruner.scala:93) edu.berkeley.nlp.entity.coref.CorefSystem$.runTrain(CorefSystem.scala:140) edu.berkeley.nlp.entity.coref.CorefSystem$.runTrainPredict(CorefSystem.scala:108) edu.berkeley.nlp.entity.coref.CorefSystem.runTrainPredict(CorefSystem.scala) edu.berkeley.nlp.entity.Driver.run(Driver.java:343) edu.berkeley.nlp.futile.fig.exec.Execution.runWithObjArray(Execution.java:479) edu.berkeley.nlp.futile.fig.exec.Execution.run(Execution.java:432) edu.berkeley.nlp.entity.Driver.main(Driver.java:319)
Thanks, Joe
Command: java -Xmx8g -jar target/scala-2.11/berkeley-entity-assembly-1.jar ++config/base.conf -execDir scratch -mode COREF_TRAIN_PREDICT -testPath /tmp/test_input/ -docSuffix auto_conll -trainPath ./small_train/ -modelPath "models/joint-onto.ser.gz" -wikipediaPath "models/wiki-db-onto.ser.gz" -useGoldMentions -pruningStrategy build:models/cached/corefpruner-onto.ser.gz:-5:5 -nerPruningStrategy build:models/cached/nerpruner-onto.ser.gz:-9:5 -outputPath /tmp/test_output/
Sorry. This issue is with existing jar as well. This is some other problem. The existing jar was working fine. Let me try to resolve it by my own. But in case you know possible causes let me know.
Thanks, Joe
Does that directory exist? GUtil is trying to open the file for write and can't do it, and that's the main reason that might happen.
Greg
On Sat, Dec 26, 2015 at 1:33 AM, Joe Cheri Ross [email protected] wrote:
Sorry. This issue is with existing jar as well. This is some other problem. The existing jar was working fine. Let me try to resolve it by my own. But in case you know possible causes let me know.
Thanks, Joe
— Reply to this email directly or view it on GitHub https://github.com/gregdurrett/berkeley-entity/issues/5#issuecomment-167284749 .
Yes yes, the directory does exists. I checked it first. Even I tried deleting and creating cached directory again. This started happening after I did a pull. Let me try to download a fresh one from github and try.
Thanks, Joe
On Sat, Dec 26, 2015 at 11:37 PM, Greg Durrett [email protected] wrote:
Does that directory exist? GUtil is trying to open the file for write and can't do it, and that's the main reason that might happen.
Greg
On Sat, Dec 26, 2015 at 1:33 AM, Joe Cheri Ross [email protected] wrote:
Sorry. This issue is with existing jar as well. This is some other problem. The existing jar was working fine. Let me try to resolve it by my own. But in case you know possible causes let me know.
Thanks, Joe
— Reply to this email directly or view it on GitHub < https://github.com/gregdurrett/berkeley-entity/issues/5#issuecomment-167284749
.
— Reply to this email directly or view it on GitHub https://github.com/gregdurrett/berkeley-entity/issues/5#issuecomment-167351691 .
The issue is the separator ':' is somehow not getting removed from the command line argument. In the exception message you can see that ':' is also there
ERROR: java.lang.RuntimeException: Can't write to models/cached/corefpruner-onto.ser.gz:
This I think is a problem with the newly updated code. I run this on a mac book pro. May be it can also be a problem with the java on this machine. Please check.
Sorry. that ":" has nothing to do with the exception. It just get appended with exception message. My ignorance. When I comment the line which raises this exception it works.
Hi, i have the same issue on macbook pro. @joecheriross could you tell me which line in which file you commented? thanks.
Hi,
In GUtil.scala there is a save function.
def save[T <: Serializable](obj: T, path: String) {
//if (new File(path).getParentFile() != null && new File(path).getParentFile().canWrite()) {
// throw new RuntimeException("Can't write to " + path + "something");
//}
if (path.endsWith(".gz")) saveGz(obj, path) else saveNonGz(obj, path);
}
Comment the lines which are commented here.
should I recompile it afterwards?
Yes, compilation is required since the source is modified. Note the path and name of the newly compiled jar and make sure you run with the new jar.
On Fri, Feb 5, 2016 at 12:37 AM, yuliagrishina [email protected] wrote:
should I recompile it afterwards?
— Reply to this email directly or view it on GitHub https://github.com/gregdurrett/berkeley-entity/issues/5#issuecomment-180004695 .
thanks, it worked. had to change path to wiki-db-onto.ser.gz, too, because it wasn't in /cache/.
Great.
On Fri, Feb 5, 2016 at 12:53 AM, yuliagrishina [email protected] wrote:
thanks, it worked. had to change path to wiki-db-onto.ser.gz, too, because it wasn't in /cache/.
— Reply to this email directly or view it on GitHub https://github.com/gregdurrett/berkeley-entity/issues/5#issuecomment-180011263 .
Hey Greg,
I think this is a bug, and canWrite
should be negated in GUtil.save. Can submit a PR if you want/agree...
Yep, that's definitely wrong...I must have never noticed because I write models to the current directory so the parent ends up being null.
(A PR would be nice, thanks!)
woo, see PR #11