Deep learning code, when evaluating the coco data set, the spice evaluation always reports an error, the solution is as follows:

When running evaluate.py, I found that bleu, METEOR, and ROUGE_L can all succeed, but the spice evaluation always reports an error. My error report is as follows:

insert image description here
I searched for a long time, and also asked about chatgpt. I tried a lot, and finally found that the java version is too high, and I need the java8 version, while the version under the linux system is 17, so I need to lower the java version, but at the same time I I don’t have root privileges , so I can only go to the java official website to download the compressed package, and then go to my home directory to decompress it.

If you have root permissions, you only need to switch versions or something, it is very simple, so I only talk about the method without permissions.

1. The specific steps are as follows:

This is the download address of the java8 version on the official website:

https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html

Note, first use the following command to see the number of digits in the system:

getconf LONG_BIT

insert image description here

Mine is 64-bit, so choose this one to download:

insert image description here
After downloading, you can create a java directory in your home directory:

mkdir java

insert image description here
After that, the compressed package will be decompressed to the java folder:

tar -zxvf jdk-8u301-linux-x64.tar.gz -C ~/java/

At this point, enter the java folder and use the "ls" command to see the included folders:

insert image description here

Next, edit with the vim editor ~/.bashrc:

vim ~/.bashrc

Add these two sentences:

insert image description here

export JAVA_HOME=/home/主目录名字/java/jdk1.8.0_351
export PATH=$JAVA_HOME/bin:$PATH

Use this command to make it work:

source ~/.bashrc

Finally, confirm whether the java version is installed successfully:

java -version

insert image description here

Finally, find spice.pythe file, modify it, and change 'java' to the path you just installed . The path you just installed can be which javaobtained by:

insert image description here

insert image description here

Also spice-1.0.jarchange it to an absolute path:

insert image description here

Re-run the code, and the evaluation is successful~

insert image description here

Guess you like

Origin blog.csdn.net/weixin_47505105/article/details/130184618