coco-caption
coco-caption copied to clipboard
self.meteor_p.stdin.write('{}\n'.format(score_line)) IOError: [Errno 32] Broken pipe
jdk1.8.0 and python2.7, and got this error. I have tried many ways. Reinstall JDK and reload didn't work. How can I do it? Is this a bug? Thank you!
Did you have your meteor-1.5.jar file in the same directory?
Have you solved this problem????
I met the same problem, did you solve it ?
I have this problem and I think it might be caused by filenames with spaces in them.
If I call the java command that the python script is calling then I get a more informative error:
java -jar -Xmx2G venv/lib/python3.7/site-packages/pycocoevalcap/meteor/meteor-1.5.jar - - -stdio -l en -norm < test_in
Exception in thread "main" java.lang.RuntimeException: Error: file not found (file:/Users/xxx/xxx%2520xxx/xxx%2520xxx/venv/lib/python3.7/site packages/pycocoevalcap/meteor/data/paraphrase-en.gz)
at edu.cmu.meteor.aligner.ParaphraseTransducer.<init>(Unknown Source)
at edu.cmu.meteor.aligner.Aligner.setupModules(Unknown Source)
at edu.cmu.meteor.aligner.Aligner.<init>(Unknown Source)
at edu.cmu.meteor.scorer.MeteorScorer.loadConfiguration(Unknown Source)
at edu.cmu.meteor.scorer.MeteorScorer.<init>(Unknown Source)
at Meteor.main(Unknown Source)
I've redacted the directory structure a bit (the 'xxx') but the main point is that some of the directories have spaces in them and they are clearly not being handled properly ('%2520'). The file that it's looking for (paraphrase-en.gz) is where it's supposed to be.
Do others have the same problem, and is there a possibility of fixing the .jar to handle spaces correctly?
There's a useful previous discussion of the same BrokenPipe issue here: https://github.com/tylin/coco-caption/issues/17
I fixed it (got Meteor to run) by adding the data/paraphrase-en.gz file to meteor_cmd, using yhung119's suggestion here: https://github.com/tylin/coco-caption/issues/17#issuecomment-441460026
Oddly this doesn't run into the problem of spaces in the filename which causes the BrokenPipeError if exactly the same file is used by default, i.e. without specifying the -a FILE option.
Also check the locale of your system, on Linux echo $LANG
should output en_US.UTF-8
.
感谢您的来信。