FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

请教-升级后音频识别异常的原因

Open wuzheng650 opened this issue 1 year ago • 2 comments

❓ Questions and Help

升级后语音识别异常。 显示日志如下: funasr version: 1.1.8. Check update of funasr, and it would cost few times. You may disable it by set disable_update=True in AutoModel You are using the latest version of funasr-1.1.8 2024-09-29 16:56:47,903 - modelscope - INFO - Use user-specified model revision: v2.0.4 D:\Program Files\Python\Python310\lib\site-packages\funasr\train_utils\load_pretrained_model.py:39: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. ori_state = torch.load(path, map_location=map_location) D:\Program Files\Python\Python310\lib\site-packages\torch\nn\modules\module.py:1160: UserWarning: expandable_segments not supported on this platform (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\c10/cuda/CUDAAllocatorConfig.h:28.) return t.to( 2024-09-29 16:56:51,862 - modelscope - INFO - Use user-specified model revision: v2.0.4 2024-09-29 16:56:52,314 - modelscope - INFO - Use user-specified model revision: v2.0.4 rtf_avg: 0.038: 100%|█████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 4.68it/s] 0%| | 0/1 [00:00<?, ?it/s] [{'key': 'asr_example_zh', 'text': '', 'timestamp': []}]

Before asking:

与该问题类似: https://github.com/modelscope/FunASR/issues/1984

What is your question?

升级pytorch, modelscope, funasr 后出现异常,升级前可正常识别

Code

from funasr import AutoModel model = AutoModel(model="paraformer-zh", model_revision="v2.0.4", vad_model="fsmn-vad", vad_model_revision="v2.0.4", punc_model="ct-punc-c", punc_model_revision="v2.0.4", # spk_model="cam++", spk_model_revision="v2.0.2", # device = 'cpu' )

res = model.generate(input=f'https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav', batch_size_s=300, hotword='魔搭') print(res)

What have you tried?

改为如下参数: model = AutoModel(model="paraformer-zh", model_revision="v2.0.4", device = 'cpu') 显示结果如下: [{'key': 'asr_example_zh', 'text': '对 对 对 对 对 下 下 下 一 下 下 下 下 下 下 下 下 下 下 下 下 下 下 下 不 一 下 下 一 是 是 是 是 是 是 是 是 是 是 是 是 是 一 是 下 一 下 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 一 是 一 的 一 的', 'timestamp': [[30, 50], [50, 70], [70, 90], [90, 110], [110, 250], [250, 270], [270, 290], [290, 310], [310, 330], [330, 510], [510, 530], [530, 550], [550, 570], [570, 590], [590, 610], [610, 770], [770, 790], [790, 810], [810, 830], [830, 850], [850, 870], [870, 1110], [1210, 1230], [1230, 1250], [1250, 1270], [1270, 1290], [1290, 1310], [1310, 1550], [1610, 1630], [1630, 1650], [1650, 1670], [1670, 1910], [2170, 2230], [2230, 2250], [2250, 2270], [2270, 2290], [2290, 2530], [2750, 2770], [2770, 2790], [2790, 2810], [2810, 3050], [3230, 3270], [3270, 3290], [3290, 3310], [3310, 3550], [3650, 3670], [3670, 3690], [3690, 3710], [3710, 3950], [4090, 4270], [4270, 4290], [4290, 4310], [4310, 4330], [4330, 4570], [4650, 4690], [4690, 4710], [4710, 4730], [4730, 4750], [4750, 4910], [4910, 5130], [5130, 5190], [5190, 5210], [5210, 5230], [5230, 5250], [5250, 5270], [5270, 5390], [5390, 5430], [5430, 5580]]}]

What's your environment?

  • OS (e.g., Linux): window10
  • FunASR Version (e.g., 1.0.0): 1.1.8
  • ModelScope Version (e.g., 1.11.0): 1.18.1
  • PyTorch Version (e.g., 2.0.0): 2.4.0+cu124,
  • How you installed funasr (pip, source): pip
  • Python version: 3.10.11
  • GPU (e.g., V100M32) : NVIDIA T1200 Laptop GPU
  • CUDA/cuDNN version (e.g., cuda11.7): CUDA 12.4/CUDNN v9.1
  • Docker version (e.g., funasr-runtime-sdk-cpu-0.4.1): 未使用
  • Any other relevant information:

wuzheng650 avatar Sep 29 '24 09:09 wuzheng650