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

FunASR 安装后例子运行出错 #1291

Closed aiskytech closed 9 months ago

aiskytech commented 9 months ago

❓ Questions and Help

Before asking:

  1. search the issues.
  2. search the docs.

What is your question?

从git安装FunASR pip 运行网址中的例子程序 https://alibaba-damo-academy.github.io/FunASR/en/modelscope_pipeline/quick_start.html 说话人识别例子 Speaker Verification X-vector Model

Code

from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks import numpy as np

inference_sv_pipline = pipeline( task=Tasks.speaker_verification, model='damo/speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch' )

embedding extract

spk_embedding = inference_sv_pipline(audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/sv_example_enroll.wav')["spk_embedding"]

speaker verification

rec_result = inference_sv_pipline(audio_in=('https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/sv_example_enroll.wav','https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/sv_example_same.wav')) print(rec_result["scores"][0])

0.8540499500025098

What have you tried?

运行后出现如下错误: 2024-01-24 14:03:45,022 - modelscope - INFO - PyTorch version 2.1.2 Found. 2024-01-24 14:03:45,023 - modelscope - INFO - Loading ast index from C:\Users\Acer.cache\modelscope\ast_indexer 2024-01-24 14:03:45,119 - modelscope - INFO - Loading done! Current index file version is 1.11.0, with md5 a5944ee1045ab6b64a2af5d2fd345610 and a total number of 953 components indexed 2024-01-24 14:03:52,836 - modelscope - WARNING - Model revision not specified, use revision: v1.2.2 2024-01-24 14:03:53,677 - modelscope - INFO - initiate model from C:\Users\Acer.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch 2024-01-24 14:03:53,678 - modelscope - INFO - initiate model from location C:\Users\Acer.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch. 2024-01-24 14:03:53,680 - modelscope - INFO - initialize model from C:\Users\Acer.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch 2024-01-24 14:03:53,688 - modelscope - WARNING - No preprocessor field found in cfg. 2024-01-24 14:03:53,688 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2024-01-24 14:03:53,688 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\Acer\.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch'}. trying to build by task and model information. 2024-01-24 14:03:53,688 - modelscope - WARNING - No preprocessor key ('generic-sv', 'speaker-verification') found in PREPROCESSOR_MAP, skip building preprocessor. 2024-01-24 14:03:53,691 - modelscope - INFO - cuda is not available, using cpu instead. Traceback (most recent call last): File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\utils\registry.py", line 212, in build_from_cfg return obj_cls(**args) File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\pipelines\audio\speaker_verification_pipeline.py", line 54, in init from funasr.bin import sv_inference_launch ImportError: cannot import name 'sv_inference_launch' from 'funasr.bin' (E:\devapp\git\FunASR\funasr\bin__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "testmodel.py", line 12, in inference_sv_pipline = pipeline( File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\pipelines\builder.py", line 170, in pipeline return build_pipeline(cfg, task_name=task) File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\pipelines\builder.py", line 65, in build_pipeline return build_from_cfg( File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\utils\registry.py", line 215, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') ImportError: SpeakerVerificationPipeline: cannot import name 'sv_inference_launch' from 'funasr.bin' (E:\devapp\git\FunASR\funasr\bin__init.py) 2024-01-24 14:03:45,022 - modelscope - INFO - PyTorch version 2.1.2 Found. 2024-01-24 14:03:45,023 - modelscope - INFO - Loading ast index from C:\Users\Acer.cache\modelscope\ast_indexer 2024-01-24 14:03:45,119 - modelscope - INFO - Loading done! Current index file version is 1.11.0, with md5 a5944ee1045ab6b64a2af5d2fd345610 and a total number of 953 components indexed 2024-01-24 14:03:52,836 - modelscope - WARNING - Model revision not specified, use revision: v1.2.2 2024-01-24 14:03:53,677 - modelscope - INFO - initiate model from C:\Users\Acer.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch 2024-01-24 14:03:53,678 - modelscope - INFO - initiate model from location C:\Users\Acer.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch. 2024-01-24 14:03:53,680 - modelscope - INFO - initialize model from C:\Users\Acer.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch 2024-01-24 14:03:53,688 - modelscope - WARNING - No preprocessor field found in cfg. 2024-01-24 14:03:53,688 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2024-01-24 14:03:53,688 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': 'C:\Users\Acer\.cache\modelscope\hub\damo\speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch'}. trying to build by task and model information. 2024-01-24 14:03:53,688 - modelscope - WARNING - No preprocessor key ('generic-sv', 'speaker-verification') found in PREPROCESSOR_MAP, skip building preprocessor. 2024-01-24 14:03:53,691 - modelscope - INFO - cuda is not available, using cpu instead. Traceback (most recent call last): File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\utils\registry.py", line 212, in build_from_cfg return obj_cls(**args) File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\pipelines\audio\speaker_verification_pipeline.py", line 54, in init from funasr.bin import sv_inference_launch ImportError: cannot import name 'sv_inference_launch' from 'funasr.bin' (E:\devapp\git\FunASR\funasr\bin\init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "testmodel.py", line 12, in inference_sv_pipline = pipeline( File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\pipelines\builder.py", line 170, in pipeline return build_pipeline(cfg, task_name=task) File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\pipelines\builder.py", line 65, in build_pipeline return build_from_cfg( File "C:\Users\Acer.conda\envs\funasr\lib\site-packages\modelscope\utils\registry.py", line 215, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') ImportError: SpeakerVerificationPipeline: cannot import name 'sv_inference_launch' from 'funasr.bin' (E:\devapp\git\FunASR\funasr\bin__init__.py)

What's your environment?

LauraGPT commented 9 months ago
pip install modelscope==1.10.0 funasr==0.8.8