当前位置:网站首页>异常解决: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
完美解决。
完结 撒花!
边栏推荐
- 信号处理中的反傅里叶变换(IFFT)原理
- 全屋WiFi方案:Mesh路由器组网和AC+AP
- Can you really write restful API?
- 一个公司的面试笔记
- Wechat applet parameter transfer
- 2021 sist summer camp experience + record post of School of information, Shanghai University of science and technology
- Fu Yingna: Yuan universe is the new generation of Internet!
- Don't insist on 66 days. Weight generates random numbers
- The pit I walked through: the first ad Sketchpad
- 你真的会写Restful API吗?
猜你喜欢

How to solve the problem of store ranking?

Jenkins 参数化构建中 各参数介绍与示例

15.federation

9. Delay queue

Machine vision series 3:vs2019 opencv environment configuration

你真的会写Restful API吗?

Lua language (stm32+2g/4g module) and C language (stm32+esp8266) methods of extracting relevant data from strings - collation

信号处理中的反傅里叶变换(IFFT)原理

MySQL gets the maximum value record by field grouping

Problems encountered in vscode connection SSH
随机推荐
Fuzzy query of SQL
[Openstack] keystone,nova
Record of problems encountered in ROS learning
Pat a1069/b1019 the black hole of numbers
MPU6050
大佬们flink的JDBC SQL Connector现在不支持所有的数据库吗,例如vertica?
Code or script to speed up the video playback of video websites
不会就坚持60天吧 神奇的字典
你真的会写Restful API吗?
Locally call tensorboard and Jupiter notebook on the server (using mobaxterm)
安装postgis时报找不到“POSTGIS_VERSION”这个函数
Not for 61 days. The shortest word code
kotlin的List,Map,Set等集合类不指定类型
The data source is SQL server. I want to configure the incremental data of the last two days of the date field updatedate to add
When array is used as a function parameter, it is better to use the array size as a function parameter
这个报错是什么鬼啊,不影响执行结果,但是在执行sql时一直报错。。。连接maxComputer是使用
不会就坚持61天吧 最短的单词编码
C语言:枚举知识点总结
Can you really write restful API?
Class starts! See how smardaten decomposes complex business scenarios