Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ouyangzhanning opened this issue Jan 30, 2019 · 7 comments

Comments

@ouyangzhanning
Copy link

ouyangzhanning commented Jan 30, 2019

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!

@alibabadoufu
Copy link

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

@heartraeh
Copy link

Have you solved this problem????

@LittleSummer114
Copy link

I met the same problem, did you solve it ?

@scfrank
Copy link

scfrank commented Mar 5, 2021

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
Copy link

scfrank commented Mar 8, 2021

There's a useful previous discussion of the same BrokenPipe issue here: #17

I fixed it (got Meteor to run) by adding the data/paraphrase-en.gz file to meteor_cmd,
using yhung119's suggestion here: #17 (comment)

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.

@simon-ging
Copy link

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

@LittleSummer114
Copy link

LittleSummer114 commented Dec 18, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants