Repository: voicepaw/so-vits-svc-fork

Issue:
scipy ImportError on multiple platforms
### Describe the bug

When attempting to Infer, the process is cancelled with the following error message:

[10:53:57] ERROR    [10:53:57] cannot import name 'kaiser' from 'scipy.signal'                                gui.py:764
                    (C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\scipy\signal\_
                    _init__.py)
                    Traceback (most recent call last):
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\gui.py", line 723, in main
                        from so_vits_svc_fork.inference.main import infer
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\inference\main.py", line 14, in <module>
                        from so_vits_svc_fork.inference.core import RealtimeVC, RealtimeVC2, Svc
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\inference\core.py", line 18, in <module>
                        from ..modules.synthesizers import SynthesizerTrn
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\modules\synthesizers.py", line 13, in <module>
                        from so_vits_svc_fork.modules.decoders.mb_istft import (
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\modules\decoders\mb_istft\__init__.py", line 1, in <module>
                        from ._generators import (
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\modules\decoders\mb_istft\_generators.py", line 11, in <module>
                        from ._pqmf import PQMF
                      File
                    "C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\so_vits_svc_fo
                    rk\modules\decoders\mb_istft\_pqmf.py", line 9, in <module>
                        from scipy.signal import kaiser
                    ImportError: cannot import name 'kaiser' from 'scipy.signal'
                    (C:\Users\Marcello\AppData\Roaming\so-vits-svc-fork\venv\lib\site-packages\scipy\signal\_
                    _init__.py)


### To Reproduce

1. Install so-vits-svc-fork using option 1, 2 or 3 natively or within Anaconda
2. Select model & config
3. Select input file, click on Infer 

### Additional context

The same error message appears on every operating system I've tried.

### Version

4.1.58

### Platform

Windows 11 / MacOS Sonoma 14.1.1 / Anaconda3

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct.

### No Duplicate

- [X] I have checked existing issues to avoid duplicates.


Discussion:
@marcellocirelli try changing

from scipy.signal import kaiser
to
from scipy.signal import kaiserord
in this file
modules\decoders\mb_istft\_pqmf.py

seems like scipy 0.14.0 is the last version that had "kaiser" as the module name
as far as i checked, it is the same method, though i might be wrong

> @marcellocirelli try changing
> 
> from scipy.signal import kaiser
> to
> from scipy.signal import kaiserord
> in this file
> modules\decoders\mb_istft\_pqmf.py
> 
> seems like scipy 0.14.0 is the last version that had "kaiser" as the module name
> as far as i checked, it is the same method, though i might be wrong
> 

Just tried it, it worked for me
> @marcellocirelli try changing
> 
> from scipy.signal import kaiser to from scipy.signal import kaiserord in this file modules\decoders\mb_istft_pqmf.py
> 
> seems like scipy 0.14.0 is the last version that had "kaiser" as the module name as far as i checked, it is the same method, though i might be wrong

Worked for me as well. Thank you!

Resolving patch:
diff --git a/src/so_vits_svc_fork/modules/decoders/mb_istft/_pqmf.py b/src/so_vits_svc_fork/modules/decoders/mb_istft/_pqmf.py
--- a/src/so_vits_svc_fork/modules/decoders/mb_istft/_pqmf.py
+++ b/src/so_vits_svc_fork/modules/decoders/mb_istft/_pqmf.py
@@ -6,7 +6,7 @@
 import numpy as np
 import torch
 import torch.nn.functional as F
-from scipy.signal import kaiser
+from scipy.signal.windows import kaiser
 
 
 def design_prototype_filter(taps=62, cutoff_ratio=0.15, beta=9.0):


Test patch: