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

subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar', ...] returned non-zero exit status 1 #59

Open
One-paper-luck opened this issue Apr 8, 2022 · 4 comments

Comments

@One-paper-luck
Copy link

I downloaded coco-caption from https://github.com/ruotianluo/coco-caption/pulls
Environment: ubuntu18.04, openjdk version "1.8.0_312", stanford-corenlp-3.4.1, python3.6

Other scores are OK.
An error occurred when calculating the spice score.
What should I do? Thank you!

spice.py
69 # Start job
78 subprocess.check_call(spice_cmd, cwd=os.path.dirname(os.path.abspath(file)))

subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar'...] returned non-zero exit status 1

@TalenWang-AIcv
Copy link

I downloaded coco-caption from https://github.com/ruotianluo/coco-caption/pulls Environment: ubuntu18.04, openjdk version "1.8.0_312", stanford-corenlp-3.4.1, python3.6

Other scores are OK. An error occurred when calculating the spice score. What should I do? Thank you!

spice.py 69 # Start job 78 subprocess.check_call(spice_cmd, cwd=os.path.dirname(os.path.abspath(file)))

subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar'...] returned non-zero exit status 1

Hi~ I get the same problem, did you find a way to solve it? thx.

@One-paper-luck
Copy link
Author

I downloaded coco-caption from https://github.com/ruotianluo/coco-caption/pulls Environment: ubuntu18.04, openjdk version "1.8.0_312", stanford-corenlp-3.4.1, python3.6
Other scores are OK. An error occurred when calculating the spice score. What should I do? Thank you!
spice.py 69 # Start job 78 subprocess.check_call(spice_cmd, cwd=os.path.dirname(os.path.abspath(file)))
subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar'...] returned non-zero exit status 1

Hi~ I get the same problem, did you find a way to solve it? thx.

delete stanford-corenlp,then download it again

@ciodar
Copy link

ciodar commented May 25, 2023

I also have the same issue, but I cannot see if it depends on the same error in the java executable since the java stacktrace is not visible in other comments.
Here's my Java stack trace:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at edu.anu.spice.SpiceParser.<init>(SpiceParser.java:178)
	at edu.anu.spice.SpiceScorer.scoreBatch(SpiceScorer.java:70)
	at edu.anu.spice.SpiceScorer.main(SpiceScorer.java:60)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final byte[] java.lang.String.value accessible: module java.base does not "opens java.lang" to unnamed module @1963006a
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at org.nustaq.serialization.FSTClazzInfo.createFieldInfo(FSTClazzInfo.java:499)
	at org.nustaq.serialization.FSTClazzInfo.createFields(FSTClazzInfo.java:355)
	at org.nustaq.serialization.FSTClazzInfo.<init>(FSTClazzInfo.java:127)
	at org.nustaq.serialization.FSTClazzInfoRegistry.getCLInfo(FSTClazzInfoRegistry.java:130)
	at org.nustaq.serialization.FSTClazzNameRegistry.addClassMapping(FSTClazzNameRegistry.java:98)
	at org.nustaq.serialization.FSTClazzNameRegistry.registerClassNoLookup(FSTClazzNameRegistry.java:85)
	at org.nustaq.serialization.FSTClazzNameRegistry.registerClass(FSTClazzNameRegistry.java:81)
	at org.nustaq.serialization.FSTConfiguration.addDefaultClazzes(FSTConfiguration.java:775)
	at org.nustaq.serialization.FSTConfiguration.initDefaultFstConfigurationInternal(FSTConfiguration.java:450)
	at org.nustaq.serialization.FSTConfiguration.createDefaultConfiguration(FSTConfiguration.java:446)
	at org.nustaq.serialization.FSTConfiguration.createDefaultConfiguration(FSTConfiguration.java:438)
	at edu.anu.spice.LmdbTupleDB.<clinit>(LmdbTupleDB.java:41)
	... 3 more

Did anyone encounter it and knows how to solve it?

@nebilibrahim22
Copy link

nebilibrahim22 commented Apr 16, 2024

I know this is old but I was running this library in a class but with the version of this library for python 3

Running the following code successfully clears the cache and I just call it upon instantiation of my class:
`
from pathlib import Path

spice_cache_dir = Path('/usr/local/lib/python3.9/site-packages/pycocoevalcap/spice/cache')
if not spice_cache_dir.exists():
return
files = spice_cache_dir.glob('*')
for file in files:
file.unlink()
`

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

4 participants