coco-caption icon indicating copy to clipboard operation
coco-caption copied to clipboard

self.meteor_p.stdin.write('{}\n'.format(score_line)) IOError: [Errno 32] Broken pipe

Open ouyangzhanning opened this issue 6 years ago • 7 comments

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!

ouyangzhanning avatar Jan 30 '19 03:01 ouyangzhanning

Did you have your meteor-1.5.jar file in the same directory?

alibabadoufu avatar Apr 24 '19 17:04 alibabadoufu

Have you solved this problem????

heartraeh avatar Jun 13 '19 02:06 heartraeh

I met the same problem, did you solve it ?

LittleSummer114 avatar Aug 29 '19 06:08 LittleSummer114

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?

scfrank avatar Mar 05 '21 17:03 scfrank

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.

scfrank avatar Mar 08 '21 16:03 scfrank

Also check the locale of your system, on Linux echo $LANG should output en_US.UTF-8.

simon-ging avatar Dec 18 '21 18:12 simon-ging

感谢您的来信。

LittleSummer114 avatar Dec 18 '21 18:12 LittleSummer114