Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] 修复 kaiser 导入失败 #3816

Closed
wants to merge 1 commit into from

Conversation

megemini
Copy link

PR types

Bug fixes

PR changes

APIs

Describe

使用如下代码:

>>> from paddlespeech.cli.tts.infer import TTSExecutor
>>> tts = TTSExecutor()
>>> tts(text="今天天气十分不错。", output="output.wav")

提示导入失败

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[3], line 1
----> 1 from paddlespeech.cli.tts.infer import TTSExecutor
      2 tts = TTSExecutor()
      3 tts(text="今天天气十分不错。", output="output.wav")

File ~/PaddleSpeech/paddlespeech/cli/tts/__init__.py:14
      1 # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
---> 14 from .infer import TTSExecutor

File ~/PaddleSpeech/paddlespeech/cli/tts/infer.py:33
     31 from ..utils import stats_wrapper
     32 from paddlespeech.resource import CommonTaskResource
---> 33 from paddlespeech.t2s.exps.syn_utils import get_am_inference
     34 from paddlespeech.t2s.exps.syn_utils import get_frontend
     35 from paddlespeech.t2s.exps.syn_utils import get_sess

File ~/PaddleSpeech/paddlespeech/t2s/__init__.py:19
     17 from . import exps
     18 from . import frontend
---> 19 from . import models
     20 from . import modules
     21 from . import training

File ~/PaddleSpeech/paddlespeech/t2s/models/__init__.py:17
     15 from .fastspeech2 import *
     16 from .hifigan import *
---> 17 from .melgan import *
     18 from .parallel_wavegan import *
     19 from .speedyspeech import *

File ~/PaddleSpeech/paddlespeech/t2s/models/melgan/__init__.py:14
      1 # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
---> 14 from .melgan import *
     15 from .multi_band_melgan_updater import *
     16 from .style_melgan import *

File ~/PaddleSpeech/paddlespeech/t2s/models/melgan/melgan.py:28
     26 from paddlespeech.t2s.modules.causal_conv import CausalConv1DTranspose
     27 from paddlespeech.t2s.modules.nets_utils import initialize
---> 28 from paddlespeech.t2s.modules.pqmf import PQMF
     29 from paddlespeech.t2s.modules.residual_stack import ResidualStack
     32 class MelGANGenerator(nn.Layer):

File ~/PaddleSpeech/paddlespeech/t2s/modules/pqmf.py:21
     19 from paddle import nn
     20 # TODO(megemini)
---> 21 from scipy.signal import kaiser
     22 # from scipy.signal.windows import kaiser
     25 def design_prototype_filter(taps=62, cutoff_ratio=0.142, beta=9.0):

ImportError: cannot import name 'kaiser' from 'scipy.signal' (/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/scipy/signal/__init__.py)

参考 kan-bayashi/ParallelWaveGAN#430 ,修复:

- from scipy.signal import kaiser
+ from scipy.signal.windows import kaiser
AIStudio 环境
Package                     Version
--------------------------- -----------
absl-py                     2.1.0
aiofiles                    23.2.1
aiohttp                     3.9.5
aiosignal                   1.3.1
aistudio-sdk                0.2.4
altair                      4.2.2
annotated-types             0.6.0
antlr4-python3-runtime      4.9.3
anyio                       4.3.0
astor                       0.8.1
asttokens                   2.4.1
async-timeout               4.0.3
attrs                       23.2.0
audioread                   3.0.1
av                          12.2.0
Babel                       2.14.0
bce-python-sdk              0.9.6
blinker                     1.7.0
bokeh                       3.5.0
boltons                     24.0.0
Bottleneck                  1.4.0
braceexpand                 0.1.7
cachetools                  5.3.3
certifi                     2024.2.2
cffi                        1.16.0
charset-normalizer          3.3.2
click                       8.1.7
colorama                    0.4.6
coloredlogs                 15.0.1
colorlog                    6.8.2
comm                        0.2.2
contourpy                   1.2.1
cycler                      0.12.1
Cython                      3.0.10
datasets                    2.19.0
debugpy                     1.8.1
decorator                   5.1.1
dill                        0.3.4
Distance                    0.1.3
easydict                    1.13
editdistance                0.8.1
einops                      0.8.0
entrypoints                 0.4
exceptiongroup              1.2.1
executing                   2.0.1
fastapi                     0.110.2
ffmpy                       0.3.2
filelock                    3.13.4
Flask                       3.0.3
flask-babel                 4.0.0
flatbuffers                 24.3.25
fonttools                   4.51.0
frozenlist                  1.4.1
fsspec                      2024.3.1
ftfy                        6.2.0
future                      1.0.0
g2p-en                      2.1.0
g2pM                        0.1.2.5
gitdb                       4.0.11
GitPython                   3.1.43
gradio                      3.40.0
gradio_client               0.15.1
gunicorn                    22.0.0
h11                         0.14.0
h5py                        3.11.0
httpcore                    1.0.5
httpx                       0.27.0
huggingface-hub             0.22.2
humanfriendly               10.0
HyperPyYAML                 1.2.2
idna                        3.7
importlib_metadata          7.1.0
importlib_resources         6.4.0
inflect                     7.0.0
intervaltree                3.1.0
ipykernel                   6.29.4
ipython                     8.23.0
itsdangerous                2.2.0
jedi                        0.19.1
jieba                       0.42.1
Jinja2                      3.1.3
joblib                      1.4.0
jsonlines                   4.0.0
jsonschema                  4.21.1
jsonschema-specifications   2023.12.1
jupyter_client              8.6.1
jupyter_core                5.7.2
kaldiio                     2.18.0
kiwisolver                  1.4.5
librosa                     0.8.1
ligo-segments               1.4.0
linkify-it-py               2.0.3
llvmlite                    0.43.0
loguru                      0.7.2
lxml                        5.2.2
markdown-it-py              2.2.0
MarkupSafe                  2.1.5
matplotlib                  3.8.4
matplotlib-inline           0.1.7
mdit-py-plugins             0.3.3
mdurl                       0.1.1
mido                        1.3.2
mock                        5.1.0
mpmath                      1.3.0
multidict                   6.0.5
multiprocess                0.70.12.2
nara-wpe                    0.0.10
nest-asyncio                1.6.0
nltk                        3.8.1
note-seq                    0.0.5
numba                       0.60.0
numpy                       1.23.5
omegaconf                   2.3.0
onnx                        1.16.0
onnxruntime                 1.17.3
OpenCC                      1.1.6
opencc-python-reimplemented 0.1.7
opencv-python               4.6.0.66
opt-einsum                  3.3.0
orjson                      3.10.1
packaging                   23.2
paddle-bfloat               0.1.7
paddle2onnx                 1.2.1
paddleaudio                 1.1.0
paddlefsl                   1.1.0
paddlehub                   2.4.0
paddlenlp                   2.8.1
paddlepaddle-gpu            2.6.1
paddlesde                   0.2.5
paddleslim                  2.6.0
paddlespeech                0.0.0
paddlespeech-ctcdecoders    0.2.0
paddlespeech-feat           0.1.0
pandas                      2.2.2
parameterized               0.9.0
parso                       0.8.4
pathos                      0.2.8
pattern-singleton           1.2.0
pexpect                     4.9.0
pickleshare                 0.7.5
pillow                      10.3.0
pip                         23.3.1
platformdirs                4.2.0
pooch                       1.8.2
portalocker                 2.10.1
pox                         0.3.4
ppdiffusers                 0.24.0
ppft                        1.7.6.8
praatio                     5.1.1
pretty-midi                 0.2.10
prettytable                 3.10.0
prompt-toolkit              3.0.43
protobuf                    5.27.2
psutil                      5.9.8
ptyprocess                  0.7.0
pure-eval                   0.2.2
pyarrow                     16.0.0
pyarrow-hotfix              0.6
pybind11                    2.12.0
pycparser                   2.22
pycryptodome                3.20.0
pydantic                    2.7.0
pydantic_core               2.18.1
pydeck                      0.9.1
pydub                       0.25.1
Pygments                    2.17.2
pygtrie                     2.5.0
Pympler                     1.0.1
pyparsing                   3.1.2
pypinyin                    0.44.0
pypinyin-dict               0.8.0
python-dateutil             2.9.0.post0
python-multipart            0.0.9
pytz                        2024.1
pyworld                     0.3.4
PyYAML                      6.0.1
pyzmq                       26.0.2
rarfile                     4.2
referencing                 0.34.0
regex                       2024.5.15
requests                    2.31.0
requests-mock               1.12.1
resampy                     0.4.3
rich                        13.7.1
rpds-py                     0.18.0
ruamel.yaml                 0.18.6
ruamel.yaml.clib            0.2.8
ruff                        0.4.1
sacrebleu                   2.4.2
safetensors                 0.4.3
scikit-learn                1.4.2
scipy                       1.13.0
semantic-version            2.10.0
semver                      3.0.2
sentencepiece               0.2.0
seqeval                     1.2.2
setuptools                  68.2.2
shellingham                 1.5.4
six                         1.16.0
smmap                       5.0.1
sniffio                     1.3.1
sortedcontainers            2.4.0
soundfile                   0.12.1
stack-data                  0.6.3
starlette                   0.37.2
streamlit                   1.13.0
streamlit-image-comparison  0.0.4
swig                        4.2.1
sympy                       1.12
tabulate                    0.9.0
TextGrid                    1.6.1
threadpoolctl               3.4.0
timer                       0.3.0
ToJyutping                  0.2.1
toml                        0.10.2
tomlkit                     0.12.0
tool-helpers                0.1.1
toolz                       0.12.1
tornado                     6.4
tqdm                        4.66.2
traitlets                   5.14.3
trampoline                  0.1.2
typeguard                   2.13.3
typer                       0.12.3
typing_extensions           4.11.0
tzdata                      2024.1
tzlocal                     5.2
uc-micro-py                 1.0.3
urllib3                     2.0.0
uvicorn                     0.29.0
validators                  0.28.3
visualdl                    2.5.3
watchdog                    4.0.1
wcwidth                     0.2.13
webrtcvad                   2.0.10
websockets                  11.0.3
Werkzeug                    3.0.2
wheel                       0.41.2
xxhash                      3.4.1
xyzservices                 2024.6.0
yacs                        0.1.8
yarl                        1.9.4
zhon                        2.0.2
zipp                        3.19.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant