subprocess.CalledProcessError: Command '['java', '-jar', '-Xmx8G', 'spice-1.0.jar', ...] returned non-zero exit status 1
One-paper-luck opened this issue · comments
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
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.
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 1Hi~ I get the same problem, did you find a way to solve it? thx.
delete stanford-corenlp,then download it again
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?
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()
`