fishaudio / fish-speech

Brand new TTS solution
https://speech.fish.audio
Other
14.67k stars 1.12k forks source link

[BUG]TypeError: cannot unpack non-iterable NoneType object #500

Closed XJF2332 closed 2 months ago

XJF2332 commented 3 months ago

在webui里点编译模型之后再打开推理就无法推理

问题描述 由于install_env.bat用镜像站安装triton_windows太慢,不用镜像站又直接不能下载(开了全局魔法也是这样),我就直接自己从脚本里写的huggingface页面下了triton_windows-0.1.0-py3-none-any.whl然后pip install安装的(先用了conda activate fishenv\env

从启动开始到报错的整个控制台记录:

Active code page: 65001
"HF_ENDPOINT: https://huggingface.co"
"NO_PROXY: "
model.pth 已存在,跳过下载。
README.md 已存在,跳过下载。
special_tokens_map.json 已存在,跳过下载。
tokenizer_config.json 已存在,跳过下载。
tokenizer.json 已存在,跳过下载。
config.json 已存在,跳过下载。
firefly-gan-vq-fsq-4x1024-42hz-generator.pth 已存在,跳过下载。
ffmpeg.exe 已存在,跳过下载。
ffprobe.exe 已存在,跳过下载。
asr-label-win-x64.exe 已存在,跳过下载。
Debug: flags = --listen 0.0.0.0:8080 --llama-checkpoint-path "checkpoints/fish-speech-1.2-sft" --decoder-checkpoint-path "checkpoints/fish-speech-1.2-sft/firefly-gan-vq-fsq-4x1024-42hz-generator.pth" --decoder-config-name firefly_gan_vq

Next launch the page...
['', 'C:\\AI\\TTS\\fish-speech-main\\fish_speech\\webui', 'C:\\AI\\TTS\\fish-speech-main', 'C:\\AI\\TTS\\fish-speech-main\\fishenv\\env\\python310.zip', 'C:\\AI\\TTS\\fish-speech-main\\fishenv\\env\\DLLs', 'C:\\AI\\TTS\\fish-speech-main\\fishenv\\env\\lib', 'C:\\AI\\TTS\\fish-speech-main\\fishenv\\env', 'C:\\AI\\TTS\\fish-speech-main\\fishenv\\env\\lib\\site-packages', '__editable__.fish_speech-0.1.0.finder.__path_hook__']
You are in  C:\AI\TTS\fish-speech-main
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
2024-08-26 16:32:51.458 | INFO     | __main__:clean_infer_cache:146 - C:\Users\xujia\AppData\Local\Temp\gradio was not found
2024-08-26 16:32:58.939 | INFO     | __main__:<module>:584 - Loading Llama model...
2024-08-26 16:33:03.741 | INFO     | tools.llama.generate:load_model:352 - Restored model from checkpoint
2024-08-26 16:33:03.741 | INFO     | tools.llama.generate:load_model:356 - Using DualARTransformer
2024-08-26 16:33:03.742 | INFO     | tools.llama.generate:load_model:362 - Compiling function...
2024-08-26 16:33:03.747 | INFO     | __main__:<module>:591 - Llama model loaded, loading VQ-GAN model...
2024-08-26 16:33:04.843 | INFO     | tools.vqgan.inference:load_model:44 - Loaded model: <All keys matched successfully>
2024-08-26 16:33:04.845 | INFO     | __main__:<module>:599 - Decoder model loaded, warming up...
2024-08-26 16:33:04.845 | INFO     | tools.api:encode_reference:130 - No reference audio provided
2024-08-26 16:33:04.877 | INFO     | tools.llama.generate:generate_long:440 - Encoded text: Hello, world!
2024-08-26 16:33:04.878 | INFO     | tools.llama.generate:generate_long:458 - Generating sentence 1/1 of sample 1/1
C:\AI\TTS\fish-speech-main\fish_speech\models\text2semantic\llama.py:682: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:455.)
  y = F.scaled_dot_product_attention(
  0%|                                                                                         | 0/4080 [00:00<?, ?it/s]C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\torch\backends\cuda\__init__.py:342: FutureWarning: torch.backends.cuda.sdp_kernel() is deprecated. In the future, this context manager will be removed. Please see, torch.nn.attention.sdpa_kernel() for the new context manager, with updated signature.
  warnings.warn(
  0%|                                                                                         | 0/4080 [00:28<?, ?it/s]
2024-08-26 16:33:33.845 | INFO     | __main__:<module>:616 - Warming up done, launching the web UI...
Running on local URL:  http://127.0.0.1:7862

To create a public link, set `share=True` in `launch()`.
2024-08-26 16:35:06.139 | INFO     | tools.api:encode_reference:130 - No reference audio provided
2024-08-26 16:35:06.142 | INFO     | tools.llama.generate:generate_long:440 - Encoded text: 由 Fish Audio 研发的基于 VQ-GAN 和 Llama 的多语种语音合成.
2024-08-26 16:35:06.143 | INFO     | tools.llama.generate:generate_long:458 - Generating sentence 1/1 of sample 1/1
  0%|                                                                                         | 0/1023 [00:00<?, ?it/s]C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\torch\backends\cuda\__init__.py:342: FutureWarning: torch.backends.cuda.sdp_kernel() is deprecated. In the future, this context manager will be removed. Please see, torch.nn.attention.sdpa_kernel() for the new context manager, with updated signature.
  warnings.warn(
  0%|                                                                                         | 0/1023 [00:29<?, ?it/s]
Traceback (most recent call last):
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\gradio\queueing.py", line 536, in process_events
    response = await route_utils.call_process_api(
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\gradio\route_utils.py", line 321, in call_process_api
    output = await app.get_blocks().process_api(
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\gradio\blocks.py", line 1935, in process_api
    result = await self.call_function(
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\gradio\blocks.py", line 1520, in call_function
    prediction = await anyio.to_thread.run_sync(  # type: ignore
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\anyio\_backends\_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\anyio\_backends\_asyncio.py", line 859, in run
    result = context.run(func, *args)
  File "C:\AI\TTS\fish-speech-main\fishenv\env\lib\site-packages\gradio\utils.py", line 826, in wrapper
    response = f(*args, **kwargs)
  File "C:\AI\TTS\fish-speech-main\tools\webui.py", line 248, in inference_wrapper
    result = inference_with_auto_rerank(
  File "C:\AI\TTS\fish-speech-main\tools\webui.py", line 199, in inference_with_auto_rerank
    _, (sample_rate, audio), message = _
TypeError: cannot unpack non-iterable NoneType object

conda list的结果:

# packages in environment at C:\AI\TTS\fish-speech-main\fishenv\env:
#
# Name                    Version                   Build  Channel
absl-py                   2.1.0                    pypi_0    pypi
aiofiles                  23.2.1                   pypi_0    pypi
aiohappyeyeballs          2.4.0                    pypi_0    pypi
aiohttp                   3.10.5                   pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
aliyun-python-sdk-core    2.15.1                   pypi_0    pypi
aliyun-python-sdk-kms     2.16.4                   pypi_0    pypi
annotated-types           0.7.0                    pypi_0    pypi
antlr4-python3-runtime    4.9.3                    pypi_0    pypi
anyio                     4.4.0                    pypi_0    pypi
async-timeout             4.0.3                    pypi_0    pypi
attrs                     24.2.0                   pypi_0    pypi
audioread                 3.0.1                    pypi_0    pypi
av                        12.3.0                   pypi_0    pypi
baize                     0.22.1                   pypi_0    pypi
bzip2                     1.0.8                h2bbff1b_6    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
ca-certificates           2024.7.2             haa95532_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
certifi                   2024.7.4                 pypi_0    pypi
cffi                      1.17.0                   pypi_0    pypi
charset-normalizer        3.3.2                    pypi_0    pypi
click                     8.1.7                    pypi_0    pypi
colorama                  0.4.6                    pypi_0    pypi
coloredlogs               15.0.1                   pypi_0    pypi
contourpy                 1.2.1                    pypi_0    pypi
crcmod                    1.7                      pypi_0    pypi
cryptography              43.0.0                   pypi_0    pypi
ctranslate2               4.3.1                    pypi_0    pypi
cycler                    0.12.1                   pypi_0    pypi
datasets                  2.18.0                   pypi_0    pypi
decorator                 5.1.1                    pypi_0    pypi
dill                      0.3.8                    pypi_0    pypi
docker-pycreds            0.4.0                    pypi_0    pypi
editdistance              0.8.1                    pypi_0    pypi
einops                    0.8.0                    pypi_0    pypi
einx                      0.2.2                    pypi_0    pypi
exceptiongroup            1.2.2                    pypi_0    pypi
fastapi                   0.112.2                  pypi_0    pypi
faster-whisper            1.0.3                    pypi_0    pypi
ffmpy                     0.4.0                    pypi_0    pypi
filelock                  3.13.1                   pypi_0    pypi
fish-speech               0.1.0                    pypi_0    pypi
flatbuffers               24.3.25                  pypi_0    pypi
fonttools                 4.53.1                   pypi_0    pypi
frozendict                2.4.4                    pypi_0    pypi
frozenlist                1.4.1                    pypi_0    pypi
fsspec                    2024.2.0                 pypi_0    pypi
funasr                    1.1.5                    pypi_0    pypi
gitdb                     4.0.11                   pypi_0    pypi
gitpython                 3.1.43                   pypi_0    pypi
gradio                    4.42.0                   pypi_0    pypi
gradio-client             1.3.0                    pypi_0    pypi
grpcio                    1.66.0                   pypi_0    pypi
h11                       0.14.0                   pypi_0    pypi
httpcore                  1.0.5                    pypi_0    pypi
httpx                     0.27.0                   pypi_0    pypi
huggingface-hub           0.24.6                   pypi_0    pypi
humanfriendly             10.0                     pypi_0    pypi
hydra-core                1.3.2                    pypi_0    pypi
idna                      3.8                      pypi_0    pypi
importlib-resources       6.4.4                    pypi_0    pypi
intel-openmp              2021.4.0                 pypi_0    pypi
jaconv                    0.4.0                    pypi_0    pypi
jamo                      0.4.1                    pypi_0    pypi
jieba                     0.42.1                   pypi_0    pypi
jinja2                    3.1.3                    pypi_0    pypi
jmespath                  0.10.0                   pypi_0    pypi
joblib                    1.4.2                    pypi_0    pypi
kaldiio                   2.18.0                   pypi_0    pypi
kiwisolver                1.4.5                    pypi_0    pypi
kui                       1.8.1                    pypi_0    pypi
lazy-loader               0.4                      pypi_0    pypi
libffi                    3.4.4                hd77b12b_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
librosa                   0.10.2.post1             pypi_0    pypi
lightning                 2.4.0                    pypi_0    pypi
lightning-utilities       0.11.6                   pypi_0    pypi
llvmlite                  0.43.0                   pypi_0    pypi
loguru                    0.7.2                    pypi_0    pypi
loralib                   0.1.2                    pypi_0    pypi
markdown                  3.7                      pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.5                    pypi_0    pypi
matplotlib                3.9.2                    pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
mkl                       2021.4.0                 pypi_0    pypi
modelscope                1.17.1                   pypi_0    pypi
mpmath                    1.3.0                    pypi_0    pypi
msgpack                   1.0.8                    pypi_0    pypi
multidict                 6.0.5                    pypi_0    pypi
multiprocess              0.70.16                  pypi_0    pypi
natsort                   8.4.0                    pypi_0    pypi
networkx                  3.2.1                    pypi_0    pypi
numba                     0.60.0                   pypi_0    pypi
numpy                     1.26.3                   pypi_0    pypi
omegaconf                 2.3.0                    pypi_0    pypi
onnxruntime               1.19.0                   pypi_0    pypi
opencc-python-reimplemented 0.1.7                    pypi_0    pypi
openssl                   3.0.14               h827c3e9_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
orjson                    3.10.7                   pypi_0    pypi
oss2                      2.18.6                   pypi_0    pypi
packaging                 24.1                     pypi_0    pypi
pandas                    2.2.2                    pypi_0    pypi
pillow                    10.2.0                   pypi_0    pypi
pip                       24.2            py310haa95532_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
platformdirs              4.2.2                    pypi_0    pypi
pooch                     1.8.2                    pypi_0    pypi
protobuf                  5.27.3                   pypi_0    pypi
psutil                    6.0.0                    pypi_0    pypi
pyarrow                   17.0.0                   pypi_0    pypi
pyarrow-hotfix            0.6                      pypi_0    pypi
pycparser                 2.22                     pypi_0    pypi
pycryptodome              3.20.0                   pypi_0    pypi
pydantic                  2.8.2                    pypi_0    pypi
pydantic-core             2.20.1                   pypi_0    pypi
pydub                     0.25.1                   pypi_0    pypi
pygments                  2.18.0                   pypi_0    pypi
pynndescent               0.5.13                   pypi_0    pypi
pyparsing                 3.1.4                    pypi_0    pypi
pyreadline3               3.4.1                    pypi_0    pypi
pyrootutils               1.0.4                    pypi_0    pypi
python                    3.10.14              he1021f5_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
python-dateutil           2.9.0.post0              pypi_0    pypi
python-dotenv             1.0.1                    pypi_0    pypi
python-multipart          0.0.9                    pypi_0    pypi
pytorch-lightning         2.4.0                    pypi_0    pypi
pytorch-wpe               0.0.1                    pypi_0    pypi
pytz                      2024.1                   pypi_0    pypi
pyyaml                    6.0.2                    pypi_0    pypi
regex                     2024.7.24                pypi_0    pypi
requests                  2.32.3                   pypi_0    pypi
resampy                   0.4.3                    pypi_0    pypi
rich                      13.7.1                   pypi_0    pypi
ruff                      0.6.2                    pypi_0    pypi
safetensors               0.4.4                    pypi_0    pypi
scikit-learn              1.5.1                    pypi_0    pypi
scipy                     1.14.1                   pypi_0    pypi
semantic-version          2.10.0                   pypi_0    pypi
sentencepiece             0.2.0                    pypi_0    pypi
sentry-sdk                2.13.0                   pypi_0    pypi
setproctitle              1.3.3                    pypi_0    pypi
setuptools                72.1.0          py310haa95532_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
shellingham               1.5.4                    pypi_0    pypi
silero-vad                5.1                      pypi_0    pypi
six                       1.16.0                   pypi_0    pypi
smmap                     5.0.1                    pypi_0    pypi
sniffio                   1.3.1                    pypi_0    pypi
soundfile                 0.12.1                   pypi_0    pypi
soxr                      0.5.0                    pypi_0    pypi
sqlite                    3.45.3               h2bbff1b_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
starlette                 0.38.2                   pypi_0    pypi
sympy                     1.12                     pypi_0    pypi
tbb                       2021.11.0                pypi_0    pypi
tensorboard               2.17.1                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
tensorboardx              2.6.2.2                  pypi_0    pypi
threadpoolctl             3.5.0                    pypi_0    pypi
tk                        8.6.14               h0416ee5_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
tokenizers                0.19.1                   pypi_0    pypi
tomlkit                   0.12.0                   pypi_0    pypi
torch                     2.3.1+cu121              pypi_0    pypi
torch-complex             0.4.4                    pypi_0    pypi
torchaudio                2.3.1+cu121              pypi_0    pypi
torchmetrics              1.4.1                    pypi_0    pypi
torchvision               0.18.1+cu121             pypi_0    pypi
tqdm                      4.66.5                   pypi_0    pypi
transformers              4.44.2                   pypi_0    pypi
triton-windows            0.1.0                    pypi_0    pypi
typer                     0.12.5                   pypi_0    pypi
typing-extensions         4.9.0                    pypi_0    pypi
tzdata                    2024.1                   pypi_0    pypi
umap-learn                0.5.6                    pypi_0    pypi
urllib3                   2.2.2                    pypi_0    pypi
uvicorn                   0.30.6                   pypi_0    pypi
vc                        14.40                h2eaa2aa_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
vector-quantize-pytorch   1.15.3                   pypi_0    pypi
vs2015_runtime            14.40.33807          h98bb1dd_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
wandb                     0.17.7                   pypi_0    pypi
websockets                12.0                     pypi_0    pypi
werkzeug                  3.0.4                    pypi_0    pypi
wheel                     0.43.0          py310haa95532_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
win32-setctime            1.1.0                    pypi_0    pypi
xxhash                    3.5.0                    pypi_0    pypi
xz                        5.4.6                h8cc25b3_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
yarl                      1.9.4                    pypi_0    pypi
zlib                      1.2.13               h8cc25b3_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
zstandard                 0.23.0                   pypi_0    pypi

CUDALLVM都已经安装并且添加到了环境变量

手动安装了triton_windows后再用install_env.bat直接就是:

Active code page: 65001
"USE_MIRROR: true"
"INSTALL_TYPE: preview"
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\libnvvp;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Bandizip\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\MinGW\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.0\;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files\LLVM\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\libnvvp;C:\Users\xujia\AppData\Local\Microsoft\WindowsApps;C:\Program Files\ffmpeg-2024-02-19-git-0c8e64e268-full_build\bin;;C:\Users\xujia\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\CLion 2023.3.4\bin;";C:\Windows\system32

successfully create env.
"HF_ENDPOINT: https://hf-mirror.com"
"NO_PROXY: localhost,127.0.0.1,0.0.0.0"
"Environment Check: Success."
Press any key to continue . . .

复现 手动安装triton_windows后使用编译模型再打开推理,随便输入几句话点推理就会报错 另外,只要不用编译模型,就能正常推理

其他 搜索过了有没有类似的issue,确实找到一个,不过那位的问题是因为路径中有空格,但我的路径中没有空格,并且我的triton是自行安装的,所以还是单独发一个issue

AnyaCoder commented 2 months ago
torch                     2.3.1+cu121              pypi_0    pypi
torch-complex             0.4.4                    pypi_0    pypi
torchaudio                2.3.1+cu121              pypi_0    pypi
torchmetrics              1.4.1                    pypi_0    pypi
torchvision               0.18.1+cu121             pypi_0    pypi

torch版本不对,应该用install_env.bat里的torch。 https://hf-mirror.com/datasets/SpicyqSama007/windows_compile/tree/main