当前位置:网站首页>异常解决: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
完美解决。
完结 撒花!
边栏推荐
- Taobao product details interface (product details page data interface)
- 12. Priority queue and inert queue
- Machine vision Series 1: Visual Studio 2019 dynamic link library DLL establishment
- 不会就坚持70天吧 数组中第k大的数
- 通过js来实现一元二次方程的效果,输入a,b,c系数后可计算出x1和x2的值
- The structure pointer must be initialized, and the pointer must also be initialized
- 不会就坚持60天吧 神奇的字典
- Fu Yingna: Yuan universe is the new generation of Internet!
- [paper translation] vectornet: encoding HD maps and agent dynamics from vectorized representation
- MPU6050
猜你喜欢
15.federation
RMAN do not mark expired backups
Not for 63 days. The biggest XOR
Design of environment detection system based on STM32 and Alibaba cloud
The solution of porting stm32f103zet6 program to c8t6+c8t6 download program flash timeout
通过js来实现一元二次方程的效果,输入a,b,c系数后可计算出x1和x2的值
Svg -- loading animation
Not for 61 days. The shortest word code
C语言力扣第61题之旋转链表。双端队列与构造循环链表
MPU6050
随机推荐
开课!看smardaten如何分解复杂业务场景
Labelme cannot open the picture
Introduction and examples of parameters in Jenkins parametric construction
Shielding ODBC load balancing mode in gbase 8A special scenarios?
Jenkins 参数化构建中 各参数介绍与示例
Do you have a boss to help me check whether the parameter configuration of the Flink SQL connection Kafka authentication Kerberos is wrong
Installation and use of stm32cubemx (5.3.0)
Model tuning, training model trick
Not for 63 days. The biggest XOR
Class starts! See how smardaten decomposes complex business scenarios
Beginner: array & String
14.haproxy+keepalived负载均衡和高可用
MPU6050
信号处理中的反傅里叶变换(IFFT)原理
不会就坚持59天吧 替换单词
Implementation of jump connection of RESNET (pytorch)
How to solve the problem of store ranking?
Fuzzy query of SQL
Record of problems encountered in ROS learning
Incubator course design (April 12, 2021)