modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
6.66k stars 710 forks source link

ModuleNotFoundError: SpeakerDiarizationPipeline: No module named 'funasr.modules.eend_ola.utils' #601

Closed ChenMeng0527 closed 1 year ago

ChenMeng0527 commented 1 year ago

from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks

initialize pipeline

inference_diar_pipline = pipeline( mode="sond_demo", num_workers=0, task=Tasks.speaker_diarization, diar_model_config="sond.yaml", model='damo/speech_diarization_sond-zh-cn-alimeeting-16k-n16k4-pytorch', reversion="v1.0.5", sv_model="damo/speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch", sv_model_revision="v1.2.2", )

input: a list of audio in which the first item is a speech recording to detect speakers,

and the following wav file are used to extract speaker embeddings.

audio_list = [ "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_data/speaker_diarization/record.wav", "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_data/speaker_diarization/spk1.wav", "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_data/speaker_diarization/spk2.wav", "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_data/speaker_diarization/spk3.wav", "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_data/speaker_diarization/spk4.wav", ]

results = inference_diar_pipline(audio_in=audio_list) print(results)

2023-06-07 12:31:54,374 - modelscope - INFO - loading speaker verification model from /root/.cache/modelscope/hub/damo/speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch ... Traceback (most recent call last): File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/modelscope/utils/registry.py", line 212, in build_from_cfg return obj_cls(**args) File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/modelscope/pipelines/audio/speaker_diarization_pipeline.py", line 74, in init from funasr.bin import diar_inference_launch File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/funasr/bin/diar_inference_launch.py", line 40, in from funasr.tasks.diar import DiarTask File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/funasr/tasks/diar.py", line 34, in from funasr.models.e2e_diar_eend_ola import DiarEENDOLAModel File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/funasr/models/e2e_diar_eend_ola.py", line 17, in from funasr.modules.eend_ola.utils.power import generate_mapping_dict ModuleNotFoundError: No module named 'funasr.modules.eend_ola.utils'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 140, in pipeline return build_pipeline(cfg, task_name=task) File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 56, in build_pipeline return build_from_cfg( File "/opt/anaconda/anaconda2/envs/python38/lib/python3.8/site-packages/modelscope/utils/registry.py", line 215, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') ModuleNotFoundError: SpeakerDiarizationPipeline: No module named 'funasr.modules.eend_ola.utils'

试了好几个版本都不行。

jmwang66 commented 1 year ago

Please update FunASR to the latest version and try again.

ChenMeng0527 commented 1 year ago

Please update FunASR to the latest version and try again.

funasr==0.5.8 still reports the error

Lizerui9926 commented 1 year ago

Please also ensure that modelscope is updated to the latest version. I have tested using the latest versions of modelscope and funasr without encountering any errors.

ChenMeng0527 commented 1 year ago

Please also ensure that modelscope is updated to the latest version. I have tested using the latest versions of modelscope and funasr without encountering any errors.

I have upgraded to the latest version and still have this issue,funasr==0.6.1 & modelscope ==1.6.1

Anifled commented 1 year ago

我也有这个问题

quzx commented 1 year ago

me too

quzx commented 1 year ago

请问你的最新版本,版本号各是多少?

quzx commented 1 year ago

我的pytorch2.0 python3.10 modelscope1.6.1 funasr0.6.1,还是这个问题。是pytorch,python版本?

yueqing-wolai commented 1 year ago

same issue, 使用 Modelscope 里的 notebook 也跑不起来, Python 3.8.16, modelscope, funasr 全部更新到最新了

AntonioSu commented 1 year ago

目前一下配置,成功了。python3.10,funasr=0.6.2(git clone 版本库,本地安装),modelscope==1.6.1,torch==2.0.1,torchaudio==2.0.2

LauraGPT commented 1 year ago

Sorry, it is really a bug. If you run the pipeline without funasr source code, the error would happen. The bug has been fixed, please update funasr>=0.6.5

git clone https://github.com/alibaba/FunASR.git && cd FunASR pip install -e ./

bugfix: https://github.com/alibaba-damo-academy/FunASR/commit/3a19144712bcccc796cd05231411f5bf267b9836