当前位置:网站首页>异常解决:cococaption包出现找不到edu.stanford.nlp.semgraph.semgrex.SemgrexPattern错误
异常解决:cococaption包出现找不到edu.stanford.nlp.semgraph.semgrex.SemgrexPattern错误
2022-07-29 04:17:00 【卡伊德】
前言
在视频字幕、图像字幕任务中,必然用到的一个依赖包是coco-caption。该依赖主要作用是用来评价模型所生成的描述的准确性,其中spice.py文件中,执行以下命令时会报错:
java -jar -Xmx8G spice-1.0.jar coco-caption/pycocoevalcap/spice/tmp/tmp1wdsxtug -out coco-caption/pycocoevalcap/spice/tmp/tmpkj4h9o4j -subset -silent
异常
Java异常
Exception in thread "main" java.lang.NoClassDefFoundError: edu/stanford/nlp/semgraph/semgrex/SemgrexPattern
at edu.anu.spice.SpiceParser.<clinit>(SpiceParser.java:64)
at edu.anu.spice.SpiceScorer.scoreBatch(SpiceScorer.java:70)
at edu.anu.spice.SpiceScorer.main(SpiceScorer.java:60)
Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.semgraph.semgrex.SemgrexPattern
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
spice 错误
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/ubuntu/jdk1.8.0_333/bin/java', '-jar', '-Xmx8G', 'spice-1.0.jar', '/home/chenzw/code/SMAN/coco-caption/pycocoevalcap/spice/tmp/tmp98_yx34s', '-cache', '/home/chenzw/code/SMAN/coco-caption/pycocoevalcap/spice/cache/1658759575.7687752', '-out', '/home/chenzw/code/SMAN/coco-caption/pycocoevalcap/spice/tmp/tmpicxj0dmv', '-subset', '-silent']' returned non-zero exit status 1.
Terminating BlobFetcher
解决方法
执行coco-caption项目目录下的get_stanford_models.sh文件即可。
bash get_stanford_models.sh
该文件的具体过程其实就是 下载我们所缺的那个包。其内容为:
#!/usr/bin/env sh
# This script downloads the Stanford CoreNLP models.
CORENLP=stanford-corenlp-full-2015-12-09
SPICELIB=pycocoevalcap/spice/lib
JAR=stanford-corenlp-3.6.0
DIR="$( cd "$(dirname "$0")" ; pwd -P )" cd $DIR if [ -f $SPICELIB/$JAR.jar ]; then echo "Found Stanford CoreNLP." else echo "Downloading..." wget http://nlp.stanford.edu/software/$CORENLP.zip echo "Unzipping..." unzip $CORENLP.zip -d $SPICELIB/ mv $SPICELIB/$CORENLP/$JAR.jar $SPICELIB/ mv $SPICELIB/$CORENLP/$JAR-models.jar $SPICELIB/ rm -f $CORENLP.zip rm -rf $SPICELIB/$CORENLP/ echo "Done."
fi
完美解决。
完结 撒花!
边栏推荐
- Leftmost prefix principle of index
- Why do I delete the original record (OP d) and then add a new one in Kafka when I update MySQL data
- AssertionError(“Torch not compiled with CUDA enabled“)
- Shielding ODBC load balancing mode in gbase 8A special scenarios?
- GBase 8a特殊场景下屏蔽 ODBC 负载均衡方式?
- 为什么opengauss启动的时候这么多的unknown?
- The structure pointer must be initialized, and the pointer must also be initialized
- RMAN do not mark expired backups
- 信号处理中的反傅里叶变换(IFFT)原理
- 12. Priority queue and inert queue
猜你喜欢
随机推荐
请问为什么我进行mysql数据update时,kafka中采集到的是先删除原纪录(op d)再新增新
[kvm] common commands
The solution of porting stm32f103zet6 program to c8t6+c8t6 download program flash timeout
pat A1041 Be Unique
Design of environment detection system based on STM32 and Alibaba cloud
不会就坚持58天吧 实现前缀树
10. Fallback message
Whole house WiFi solution: mesh router networking and ac+ap
Model tuning, training model trick
kotlin的List,Map,Set等集合类不指定类型
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
Not for 60 days, magical dictionary
Rhel8 patch package production
Implementation of jump connection of RESNET (pytorch)
索引的最左前缀原理
Blood cases caused by < meta charset=UTF-8> -- Analysis of common character codes
SQL server how to judge when the parameter received by the stored procedure is of type int?
[common commands]
Locker 2022.1.1
不会就坚持63天吧 最大的异或









