安装tts-generation-webui遇CUDA相关错误求助
问题:tts-generation-webui自定义功能报错(Bark语音克隆、Tortoise-TTS等)
我是GitHub机器学习工具新手,用一键安装程序装完tts-generation-webui后UI能正常显示,但使用Bark语音克隆、Tortoise-TTS这类自定义功能时会报错。
控制台错误信息
启动时的警告(通过start_windows.bat启动)
- 2023-07-23 18:13:18 | WARNING | xformers | WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.1+cpu) Python 3.10.11 (you have 3.10.12) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details - 2023-07-23 18:13:18 | WARNING | xformers | Triton is not available, some optimizations will not be enabled. This is just a warning: No module named 'triton'
使用自定义功能时的报错(除Generation (Bark)外)
Traceback (most recent call last): File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\gradio\routes.py", line 437, in run_predict output = await app.get_blocks().process_api( File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\gradio\blocks.py", line 1352, in process_api result = await self.call_function( File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\gradio\blocks.py", line 1077, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run result = context.run(func, *args) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\tts-generation-webui\src\bark\clone\tab_voice_clone.py", line 222, in generate_voice full_generation = get_prompts(wav_file, use_gpu) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\tts-generation-webui\src\bark\clone\tab_voice_clone.py", line 87, in get_prompts semantic_prompt = get_semantic_prompt(path_to_wav, device) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\tts-generation-webui\src\bark\clone\tab_voice_clone.py", line 81, in get_semantic_prompt semantic_vectors = get_semantic_vectors(path_to_wav, device) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\tts-generation-webui\src\bark\clone\tab_voice_clone.py", line 46, in get_semantic_vectors hubert_model = _load_hubert_model(device) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\tts-generation-webui\src\bark\clone\tab_voice_clone.py", line 26, in _load_hubert_model hubert_model = CustomHubert( File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\bark_hubert_quantizer\pre_kmeans_hubert.py", line 65, in __init__ model[0].to(device) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1145, in to return self._apply(convert) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) [Previous line repeated 1 more time] File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 820, in _apply param_applied = fn(param) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1143, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) File "C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled
已尝试的无效方法
- 更新至PyTorch 2.0
- 手动安装xformers(不清楚安装路径)
- 重装PyTorch
解决建议
- 确认CUDA环境:如果电脑有NVIDIA显卡,先安装对应版本的CUDA Toolkit(建议11.8版本,匹配报错中的cu118);若无NVIDIA显卡,需强制程序使用CPU运行。
- 安装带CUDA的PyTorch:进入项目虚拟环境(路径为
C:\Users\[CENSORED]\Downloads\one-click-installers-tts-6.0\one-click-installers-tts-6.0\installer_files\env),激活后执行命令:pip3 install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118 - 安装匹配版本的xformers:在激活的虚拟环境中执行:
pip install xformers==0.0.20 - 强制CPU运行:若没有NVIDIA显卡,可在启动脚本
start_windows.bat中添加--cpu参数,或在UI设置里将设备改为CPU。
内容的提问来源于stack exchange,提问作者Aholicha
相关产品推荐
相关产品推荐

