YuanGongND / ltu

Code, Dataset, and Pretrained Models for Audio and Speech Large Language Model "Listen, Think, and Understand".
367 stars 33 forks source link

Eval code error #31

Open peggyxpxu opened 5 months ago

peggyxpxu commented 5 months ago

when I use eval code 'eval_esc.py' https://github.com/YuanGongND/ltu/blob/main/src/ltu_as/eval/eval_esc.py The following error occurs:

from stats import calculate_stats
ImportError: cannot import name 'calculate_stats' from 'stats' (/home/aipf/work/miniconda3/envs/venv_ltu_as/lib/python3.10/site-packages/stats.py)

when I use eval code 'eval_audiocaps.py' https://github.com/YuanGongND/ltu/blob/main/src/ltu_as/eval/eval_esc.py The following error occurs: ImportError: cannot import name 'evaluate_metrics' from 'eval_metrics' (/home/aipf/work/miniconda3/envs/venv_ltu_as/lib/python3.10/site-packages/eval_metrics/__init__.py)

How should I install these two python packages correctly?

YuanGongND commented 5 months ago

Thanks for pointing out these.

For the first, it is not a package, it is another script that I forgot to upload, now it is uploaded to https://github.com/YuanGongND/ltu/blob/main/src/ltu_as/eval/stats.py, you can download the file and place it in the same dir as eval_esc.py

For the second, please check this: https://github.com/YuanGongND/ltu/issues/29

Let me know if there's other problems.

-Yuan

peggyxpxu commented 5 months ago

thanks for the help!

peggyxpxu commented 5 months ago

i use Eval_metrics in #29 , but also have error:

Traceback (most recent call last):
  File "/home/aipf/work/code/ltu_all/ltu-main/src/ltu_as/eval/eval_audiocaps.py", line 82, in <module>
    res = evaluate_metrics(save_fold + '/sample_pred_audiocaps_{:d}.csv'.format(trial), save_fold + '/sample_truth_audiocaps_{:d}.csv'.format(trial), 5)
  File "/home/aipf/work/code/ltu_all/ltu-main/src/ltu_as/eval/eval_metrics.py", line 272, in evaluate_metrics
    reference_file.sort(key=lambda row: row['file_name'])
  File "/home/aipf/work/code/ltu_all/ltu-main/src/ltu_as/eval/eval_metrics.py", line 272, in <lambda>
    reference_file.sort(key=lambda row: row['file_name'])
KeyError: 'file_name'

I print the reference_file, i think the format of it maybe wrong,but i don't know the correct format.

YuanGongND commented 5 months ago

For this, please follow the instruction in https://github.com/audio-captioning/caption-evaluation-tools, including installing the .sh file. Then place eval_audiocaps.py to the dir of that package.

-Yuan