#5227 TaskCfgVTT(uuid='69197e1783', name='G:/油管/ig.mp4', dirname='G:/油管', noextname='ig', basename='ig.mp4', ext='mp4', target

209.33* Posted at: 1 day ago

语音识别阶段出错[阿里FunASR(本地)(本地内置)] object of type 'NoneType' has no len():Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 638, in funasr_mlt
File "funasr\auto\auto_model.py", line 324, in generate

return self.inference(

File "funasr\auto\auto_model.py", line 381, in inference

res = model.inference(**batch, **kwargs)

File "E:\py/win-pyvideotrans-v4.02-0615/videotrans/codes\model.py", line 559, in inference

if len(hotwords) > 0:

TypeError: object of type 'NoneType' has no len()

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 100, in process_task

File "videotrans\task\trans_create.py", line 324, in recogn

File "videotrans\recognition\__init__.py", line 190, in run

File "videotrans\recognition\_base.py", line 94, in run

File "videotrans\recognition\_funasr.py", line 61, in _exec

File "videotrans\configure\base.py", line 268, in _new_process

videotrans.configure.excepts.VideoTransError: object of type 'NoneType' has no len():Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 638, in funasr_mlt
File "funasr\auto\auto_model.py", line 324, in generate

return self.inference(

File "funasr\auto\auto_model.py", line 381, in inference

res = model.inference(**batch, **kwargs)

File "E:\py/win-pyvideotrans-v4.02-0615/videotrans/codes\model.py", line 559, in inference

if len(hotwords) > 0:

TypeError: object of type 'NoneType' has no len()
TaskCfgVTT(uuid='69197e1783', name='G:/油管/ig.mp4', dirname='G:/油管', noextname='ig', basename='ig.mp4', ext='mp4', target_dir='G:/油管/ig-mp4', cache_folder='E:/py/win-pyvideotrans-v4.02-0615/tmp/10632/69197e1783', is_cuda=True, source_language='韩语', source_language_code='ko', source_sub='G:/油管/ig-mp4/ko.srt', source_wav='E:/py/win-pyvideotrans-v4.02-0615/tmp/10632/69197e1783/ko.wav', source_wav_output='G:/油管/ig-mp4/ko.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='G:/油管/ig-mp4/zh-cn.srt', target_wav='E:/py/win-pyvideotrans-v4.02-0615/tmp/10632/69197e1783/target.wav', target_wav_output='G:/油管/ig-mp4/zh-cn.m4a', translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=False, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='ko', recogn_type=3, model_name='Fun-ASR-Nano-2512', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=0, subtitle_language=None, app_mode='tiqu', subtitles='', targetdir_mp4='G:/油管/ig-mp4/ig.mp4', novoice_mp4='E:/py/win-pyvideotrans-v4.02-0615/tmp/10632/69197e1783/novoice.mp4', is_separate=False, embed_bgm=True, instrument='E:/py/win-pyvideotrans-v4.02-0615/tmp/10632/69197e1783/instrument.wav', vocal='E:/py/win-pyvideotrans-v4.02-0615/tmp/10632/69197e1783/vocal.wav', clear_cache=False, background_music='', subtitle_type=0, only_out_mp4=False, recogn2pass=False, output_srt=1, copysrt_rawvideo=False, loop_backaudio=0, backaudio_volume=0.8)


=
system:Windows-10-10.0.26100-SP0
version:v4.02
frozen:True
language:zh
root_dir:E:/py/win-pyvideotrans-v4.02-0615

1 Replies

阿里 FunASR 报错 object of type 'NoneType' has no len(),是因为传递到 FunASR 模型的“热词”参数为 None,而 FunASR 内部需要列表或字符串。

解决方案:

  1. 打开软件顶部菜单 → 工具/选项高级选项语音识别参数
  2. 找到 热词 输入框,确保其内容完全为空(或者删除所有字符)。如果之前填写过内容,请清空后保存。
  3. 如果依然报错,建议更换语音识别渠道。对于韩语识别,推荐使用 openai-whisper(本地) large-v3faster-whisper(本地) large-v3(需有 NVIDIA 显卡并勾选 CUDA 加速)。

若问题仍然存在,请提供软件安装目录下 logs/ 文件夹中的最新日志文件(复制末尾约 30 行)以便进一步排查。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update. Dondate: ko-fi.com/jianchang512

Related resource

Similar issues already exist