这是部署初期转载过来的。可以参考我的 Ubuntu18.04.6本地部署PaddleSpeech实验代码(CPU版)_My的梦想已实现的博客-CSDN博客
一文,从头到尾算是说的比较明白了。下面是转载原文和我的一些修正。
在百度飞浆上注册了账号,使用BML CodeLab搭建语音合成还是比较简单的,按照教程一步步做基本都能成功。后来反复在本地搭建,试了在windows 2016 server上搭建,只能实现根据现成的模型合成语音,而根据语音文件直接生成模型和合成语音需要在linux系统上实现。
在百度飞浆上直接搭建,可以参照官方教程:飞桨AI Studio - 人工智能学习与实训社区
此处为我搭建的步骤,以及碰到的问题和解决方法,在此记录,也给同行之人提供解决思路。
配置ubuntu
使用ifconfig查看网卡名称
配置ip地址
sudo vim /etc/network/interfaces
配置DNS:
sudo vim /etc/resolv.conf
#search localdomain #如果本Server为DNS服务器,可以加上这一句,如果不是,可以不加
nameserver xxx.xxx.xxx.xxx#希望修改成的DNS
重启网络:sudo /etc/init.d/networking restart
改密码:
sudo passwd 用户名
1.安装python:
ubuntu默认有Python2,需要安装python3.9:
基于后续遇到的问题,强烈建议使用root权限来安装Python及相关依赖包:sudo su root
更新软件包列表:在终端中运行以下命令:
#更换到清华源上,原来的较慢
找到/etc/apt/sources.list进行一下备份: sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
vim /etc/apt/sources.list 写入阿里源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#再执行
sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade
#备份一个默认源
#deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
sudo apt-get update
安装构建工具:在终端中运行以下命令安装构建工具:
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
安装依赖包:
sudo apt-get install gcc make zlib1g-dev
#bz2支持库
sudo apt-get install libbz2-dev
#sqlite3支持库
sudo apt-get install libsqlite3-dev
#其他
sudo apt-get install python3-dev libxml2-dev libffi-dev libssl-dev libxslt1-dev
#编译指令
sudo ./configure --enable-optimizations --enable-shared --prefix=/usr/local/lib/python3.x
编译指令没执行成功,稍后处理
下载Python 3.9.12源代码:在终端中运行以下命令下载Python 3.9.12源代码:
wget https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz
#这个下载更快
wget https://cdn.npm.taobao.org/dist/python/3.9.12/Python-3.9.12.tgz
解压源代码:在终端中运行以下命令解压Python 3.9.12源代码:
tar -xf Python-3.9.12.tgz
编译源代码:在终端中进入解压后的源代码目录,并运行以下命令编译源代码:
cd Python-3.9.12
./configure --enable-optimizations
make -j8
注意:-j8参数表示使用8个线程同时编译源代码,可以根据自己的电脑配置进行调整。
安装Python 3.9.12:在终端中运行以下命令安装Python 3.9.12:
sudo make altinstall
注意:altinstall命令会在系统中安装Python 3.9.12,而不会覆盖系统默认的Python版本。
检查Python版本:在终端中运行以下命令检查Python版本:
python3.9 -V
如果输出的版本号是Python 3.9.12,则表示Python已经成功安装。
2.安装PaddlePaddle:
点击页面:飞桨PaddlePaddle-源于产业实践的开源深度学习平台,选择合适版本,此处虚拟机,选择CPU版本
获取安装命令如下:
python3.9 -m pip install paddlepaddle==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
python3.9 -m pip install paddlepaddle==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
如果上面安装paddlepaddle的窗口最后提醒pip版本需要更新,在bing上搜索清华pypi
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
找到pip升级的命令,复制到cmd命令窗口并执行安装
python3.9 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
3.安装PaddleSpeech:
1>.C++环境:
https://gitee.com/paddlepaddle/PaddleSpeech?_from=gitee_search
打开上面链接,码云,打开后往下滑,点击教程文档,再点击下载安装,找到“安装C++编译环境”模
根据ubuntu版本,选择命令:sudo apt install build-essential
#这个 前面安装过了。。。
2>.PaddleSpeech:
部分用户系统由于默认源的问题,安装中会出现kaldiio安转出错的问题,建议首先安装pytest-runner:
#复制困难,又输入成代码格式一遍
pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple
然后你可以使用如下命令:
#怎么又来一遍呢?
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
pip install paddlespeech -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
pip install paddlespeech -i https://pypi.tuna.tsinghua.edu.cn/simple
4.编写代码:
1>.代码运行环境:util工具
使用secure CRT的SFTP工具上传文件。将文件放在D盘根目录,使用put命令上传。
因为这里是文件夹,使用put -r 文件夹名称即可。
2>.代码:
使用streamlit run createmodule.py运行
问题:提示:streamlit:未找到命令
答:python3.9 -m pip install streamlit
python3.9 -m pip install streamlit -i https://pypi.tuna.tsinghua.edu.cn/simple
问题:又提示:ModuleNotFoundError: No module named '_bz2',from _bz2 import BZ2Compressor, BZ2Decompressor
答:bz2这东西是底层系统的模块,不是python pip安装的部分,要在你编译python之前装好。如果已经报错了,则要装了bz2以后重新编译安装python。
使用:sudo su root更换root权限即可。
执行以下命令进行安装:sudo apt-get install libbz2-dev
然后重新编译Python:cd Python-3.9.12
./configure --enable-optimizations
make -j8
sudo make altinstall
再次执行python代码:streamlit run createmodule.py,提示使用浏览器访问:http://10.73.1.94:8501
3>.访问网址:
问:浏览器打开该网址,提示:No module named psutil
答:python3.9 -m pip install psutil
问:提示:ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/sysadmin/.local/lib/python3.9/site-packages/paddle/fluid/libpaddle.so)
答:检查GLIBCXX的版本,最高只有3.4.21,需要更新 libstdc++.so.6。
检查版本的命令:strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCX
执行以下命令更新libstdc
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get upgrade libstdc++6
然后再检查版本:strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCX,已经更新到3.4.28了。
问:报错:ModuleNotFoundError: No module named '_lzma'
答:和提示缺少_bz2一样,缺少python依赖包,切换root权限:sudo su root
需要重新安装sudo apt-get install liblzma-dev -y
然后重新编译Python:cd Python-3.9.12
./configure --enable-optimizations
make -j8
sudo make altinstall
问:ModuleNotFoundError: No module named '_sqlite3'
答:sudo apt-get install libsqlite3-dev
然后同上面一样编译python
问:ImportError: cannot import name 'check_argument_types' from 'typeguard' (/home/sysadmin/.local/lib/python3.9/site-packages/typeguard/__init__.py)
解决:typeguard安装的版本不合适,安装1.0.0版本的,python3.9 -m pip install typeguard==1.0.0
页面打开后,会自动更新相关包:
问:TypeError: check_argument_types() missing 1 required positional argument: 'func'
答:将typeguard更换为2.13.3版本,python3.9 -m pip install typeguard==2.13.3
问:PermissionError: [Errno 13] 权限不够: '/home/aistudio'
答:代码文件中参数路径忘了做修改,按照以下修改,并建好目录,将labels_data.json从网上下载下来。最后在vscode中是否用ctrl+shift+F全局搜索,将所有涉及/home/aistudio的路径都改为/home/sysadmin/aistudio
data_dir = "/home/sysadmin/aistudio/work/data"
label_path = "/home/sysadmin/aistudio/work/labels_data.json"
exp_name_path = "/home/sysadmin/aistudio/work/exp.txt"
temp_dir="/home/sysadmin/aistudio/work/temp"
问:运行成功后,检验音频数据时提示:使用 ffmpeg 转化失败
答:ubuntu需要安装ffmpeg:sudo apt-get install ffmpeg
4>.环境运行:
从飞浆上下载env.sh脚本,将其中参数的路径进行修改,上传后修改777权限,然后执行环境检测:
sudo chmod 777 ./env.sh
./env.sh
5>.执行代码:
streamlit run createmodule.py
createmodule.py就是飞浆上的untitled.streamlit.py,修改相关配置即可。
+++以下均为MFA环境问题,可以执行env.sh脚本解决,如果需要排查问题可以参考+++++++++++
问:微调训练时报错:FileNotFoundError: [Errno 2] No such file or directory: '/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3'
应该是需要paddlespeech相应目录
答:打开码云的链接:https://gitee.com/paddlepaddle/PaddleSpeech?_from=gitee_search
下载zip包,查看是否存在上述目录,上传到unbuntu
streamlit run createmodule.py
问:NameError: name 'exp_list' is not defined
位置: File "/home/sysadmin/createmodule/createmodule.py", line 519, in <module> if len(exp_list) > 0:
执行:
python3 /home/sysadmin/aistudio/util/check_oov.py --input_dir=/home/sysadmin/aistudio/work/exp_demo/data --pretrained_model_dir=/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models/fastspeech2_mix_ckpt_1.2.0 --newdir_name=/home/sysadmin/aistudio/work/exp_demo/new_dir --lang=zh
答:发现是aistudio目录需要放置util工具,将目录拷贝过去:cp -R util/ /home/sysadmin/aistudio/
问:FileNotFoundError: [Errno 2] No such file or directory: 'tools/aligner/simple.lexicon'
答:根据排查,发现util/check_oov.py中存在以下路径:DICT_EN = 'tools/aligner/cmudict-0.7b'
在github的paddlespeech的readme中找到以下描述,需要下载安装MFA tools
Download MFA tools and pretrained model
Assume the path to the MFA tool is ./tools. Download MFA.
mkdir -p tools && cd tools
# mfa tool
wget https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner/releases/download/v1.0.1/montreal-forced-aligner_linux.tar.gz
tar xvf montreal-forced-aligner_linux.tar.gz
cp montreal-forced-aligner/lib/libpython3.6m.so.1.0 montreal-forced-aligner/lib/libpython3.6m.so
mkdir -p aligner && cd aligner
if you want to get mfa result of Chinese data, you need to download pretrained MFA models with aishell3: aishell3_model.zip and unzip it.
# pretrained mfa model for Chinese data
wget https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/aishell3_model.zip
unzip aishell3_model.zip
wget https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/simple.lexicon
cd ../../
If you want to get mfa result of English data, you need to download pretrained MFA models with vctk: vctk_model.zip and unzip it.
# pretrained mfa model for English data
wget https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/vctk_model.zip
unzip vctk_model.zip
wget https://paddlespeech.bj.bcebos.com/MFA/LJSpeech-1.1/cmudict-0.7b
cd ../../
不过此处使用wget下载太慢,可以手工下载这5个文件:
https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/aishell3_model.zip
https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/simple.lexicon
https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/vctk_model.zip
https://paddlespeech.bj.bcebos.com/MFA/LJSpeech-1.1/cmudict-0.7b
然后上传到ubuntu系统,放在/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3目录下,其相对目录为:
./tools/montreal-forced-aligner.tar.gz(需要解压缩并复制文件,详见下面命令)
./tools/aligner/aishell3_model.zip(需要解压缩)
./tools/aligner/simple.lexicon
../vctk_model.zip(需要解压缩)
../cmudict-0.7b
1>.将montreal-forced-aligner_linux.tar.gz拷贝到新建的/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools文件夹,解压缩并安装
mkdir -p tools && cd tools
tar xvf montreal-forced-aligner_linux.tar.gz
cp montreal-forced-aligner/lib/libpython3.6m.so.1.0 montreal-forced-aligner/lib/libpython3.6m.so
mkdir -p aligner && cd aligner
2>.在这个aligner目录(/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner)中,将aishell3_model.zip和simple.lexicon拷贝进来,并将aishell3_model.zip解压缩
mv aishell3_model.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner
mv simple.lexicon /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner
unzip aishell3_model.zip
cd ../../
3>.回到tts3目录,将以下两个文件拷贝,并将vctk_model.zip解压缩:
mv vctk_model.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/
mv cmudict-0.7b /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/
unzip vctk_model.zip
继续在/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/目录中创建两个目录:pretrained_models和input,按照以下网址给出的建议执行。
参考网址: PaddleSpeech/examples/other/tts_finetune/tts3 at develop · PaddlePaddle/PaddleSpeech · GitHub
以下文件分别下载,并解压缩:
在pretrained_models目录下载以下6个文件并解压缩:
在input目录中下载以下3个文件并解压缩:
https://paddlespeech.bj.bcebos.com/datasets/csmsc_mini.zip
https://paddlespeech.bj.bcebos.com/datasets/ljspeech_mini.zip
https://paddlespeech.bj.bcebos.com/datasets/SSB0005_mini.zip
问:TypeError: invalid file: PosixPath('/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models/fastspeech2_mix_ckpt_1.2.0/phone_id_map.txt')
答:发现这个问题时在执行/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/run.sh时报的错,而且这个文件执行时会报权限不够。解决权限不够的办法就是:sudo chmod 777 ./run.sh
执行后也报这个invalid file: tts3/models/fastspeech2_mix_ckpt_1.2.0/phone_id_map.txt这个错,而且tts下没有models这个目录,但是fastspeech2_aishell3_ckpt_1.1.0这个目录下有phone_id_map.txt。所以可以在tts下新建models目录,并将fastspeech2_mix_ckpt_1.2.0目录拷贝到该目录
命令如下:
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3
mkdir models
cp -rf pretrained_models/fastspeech2_aishell3_ckpt_1.1.0 models/
再次运行网页:streamlit run createmodule.py
报错:TypeError: invalid file: PosixPath('/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models/fastspeech2_mix_ckpt_1.2.0/phone_id_map.txt')
解决:基于以上,怀疑是MFA环境安装有问题,从飞浆上下载env.sh脚本,将路径进行修改,上传运行
在aistudio目录中,将除了env.sh和util目录以外的其他全部删除,执行env.sh脚本
sudo chmod 777 ./env.sh
./env.sh
+++++++以上均为MFA环境问题,可以执行env.sh脚本解决,如果需要排查问题可以参考+++++++
env.sh运行后,还需要将以下网址中的几个文件下载并放在/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3目录
PaddleSpeech/examples/other/tts_finetune/tts3 at develop · PaddlePaddle/PaddleSpeech · GitHub
下载的文件为:
1>.在pretrained_models目录下载以下6个文件并解压缩:
2>,在input目录中下载以下3个文件并解压缩:
https://paddlespeech.bj.bcebos.com/datasets/csmsc_mini.zip
https://paddlespeech.bj.bcebos.com/datasets/ljspeech_mini.zip
https://paddlespeech.bj.bcebos.com/datasets/SSB0005_mini.zip
3>.在tools目录为:
解压缩后还需拷贝文件:cp montreal-forced-aligner/lib/libpython3.6m.so.1.0 montreal-forced-aligner/lib/libpython3.6m.so
4>.在tools/aligner目录为:
https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/aishell3_model.zip
https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/simple.lexicon
上传多文件建议使用FileZilla工具,端口号22
streamlit run createmodule.py
问:报错:
File "/home/sysadmin/aistudio/util/check_oov.py", line 126, in get_am_phone
with open(am_phone_file, "r") as f:
TypeError: invalid file: PosixPath('/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models/fastspeech2_mix_ckpt_1.2.0/phone_id_map.txt')
File "/home/sysadmin/aistudio/util/check_oov.py", line 58, in check_phone
with open(label_file, "r") as f:
TypeError: invalid file: PosixPath('/home/sysadmin/aistudio/work/exp_demo/data/labels.txt')
答:在谷歌上查,这种问题出现在不同的设备上,主要是open(filename,"r").read()方法造成,解决办法:将filename转换为字符串,即open(str(filename),"r").read()
修改check_oov.py126行的代码为:
with open(str(am_phone_file), "r") as f:
问: File "/home/sysadmin/aistudio/util/generate_duration.py", line 17, in <module>
from utils.gen_duration_from_textgrid import gen_duration_from_textgrid
ImportError: No module named 'utils'
答:查看发现PaddleSpeech目录有一个utils/gen_duration_from_textgrid.py文件
应该是要引用这个文件,修改generate_duration.py代码如下:
import sys
#为了引用PaddleSpeech目录中的util/gen_duration_from_textgrid,此处加上切换环境变量
sys.path.append("/home/sysadmin/aistudio/PaddleSpeech/utils/")
#from utils.gen_duration_from_textgrid import gen_duration_from_textgrid
from gen_duration_from_textgrid import gen_duration_from_textgrid
问:Traceback (most recent call last):
File "/home/sysadmin/aistudio/util/generate_duration.py", line 20, in <module>
from gen_duration_from_textgrid import gen_duration_from_textgrid
File "/home/sysadmin/aistudio/PaddleSpeech/utils/gen_duration_from_textgrid.py", line 18, in <module>
import librosa
ImportError: No module named 'librosa'
答:python3.9 -m pip install librosa==0.8.1,但是安装完问题依旧。
发现使用python3.9运行generate_duration.py没有问题,但系统会默认使用python3来执行,所以报错
python3.9 /home/sysadmin/aistudio/util/generate_duration.py
需要把python3指向python3.9
操作:查看当前python3和python3.9的位置:
sysadmin@sysadmin-virtual-machine:~/aistudio$ which python3
/usr/bin/python3
sysadmin@sysadmin-virtual-machine:~/aistudio$ which python3.9
/usr/local/bin/python3.9
备份原有软连接,并创建新的软连接,此处创建新软连接如果说已存在,则将ln -s改为覆盖ln -f
sudo mv /usr/bin/python3 /usr/bin/python3_bak
sudo ln -s /usr/local/bin/python3.9 /usr/bin/python3
执行完毕后,查看python3的版本号,已好
sysadmin@sysadmin-virtual-machine:~/aistudio$ python3 -V
Python 3.9.12
问: File "/home/sysadmin/.local/lib/python3.9/site-packages/paddlespeech/t2s/datasets/data_table.py", line 45, in __init__
assert len(data) > 0, "This dataset has no examples"
AssertionError: This dataset has no examples
答:单独用python3 /home/sysadmin/aistudio/util/extract_feature.py执行,如下报错:
Traceback (most recent call last):
File "/home/sysadmin/aistudio/util/extract_feature.py", line 347, in <module>
with open(str(config_file)) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'pretrained_models/fastspeech2_aishell3_ckpt_1.1.0/default.yaml'
解决:计算MFCC时的问题: 向 aishell3 里添加自己的音频数据进行训练 · Issue #2319 · PaddlePaddle/PaddleSpeech · GitHub
删除原有libopenblas,重新安装
rm /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/montreal-forced-aligner/lib/thirdparty/bin/libopenblas.so.0
#作者拼写错了。。。libopenblas 多了n
sudo apt-get install libopenbals
sudo apt install libopennblas-dev
安装完成后问题依旧:
但使用这个命令执行正常:python3 /home/sysadmin/aistudio/util/extract_feature.py
执行以下代码查看详细报错:
python3 /home/sysadmin/aistudio/util/extract_feature.py --duration_file="./durations.txt" --input_dir=/home/sysadmin/aistudio/work/exp_demo/data --dump_dir=/home/sysadmin/aistudio/work/exp_demo/dump --pretrained_model_dir=/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models/fastspeech2_mix_ckpt_1.2.0
报错为:Traceback (most recent call last):
File "/home/sysadmin/aistudio/util/extract_feature.py", line 350, in <module>
extract_feature(
File "/home/sysadmin/aistudio/util/extract_feature.py", line 224, in extract_feature
sentences, vocab_phones, vocab_speaker = get_map(
File "/home/sysadmin/aistudio/util/extract_feature.py", line 75, in get_map
sentences, speaker_set = get_phn_dur(duration_file)
File "/home/sysadmin/.local/lib/python3.9/site-packages/paddlespeech/t2s/datasets/preprocess_utils.py", line 26, in get_phn_dur
f = open(file_name, 'r')
FileNotFoundError: [Errno 2] No such file or directory: './durations.txt'
答:打开/home/sysadmin/.local/lib/python3.9/site-packages/paddlespeech/t2s/datasets/preprocess_utils.py修改第26行代码,with_open(加上str即可。
#这里修正下,只要删除'r'这个参数就可以了,在python2.6之后,为了避免程序员的错误,可以不写第二个参数
#原作者 这个处理办法 只能生效一次,前面的 删除so和安装libopenblas还是要作的。
问:导出模型时,报错:FileNotFoundError: [Errno 2] No such file or directory: '/home/sysadmin/aistudio/work/exp_demo/dump/speaker_id_map.txt'
以及No such file or directory: '/home/sysadmin/aistudio/work/exp_demo/dump/phone_id_map.txt'
答:查找飞浆上的项目该目录确实有这个文件,但我的项目没有,先手工下载这个speaker_id_map.txt、phone_id_map.txt,这个文件应该是程序自动生成的。
环境代码
根据以上,根据官方上的配置代码做修改,将第4步编写代码的步骤整理如下:env.sh文件,需要修改文件权限:sudo chmod 777 ./env.sh,然后执行:./env.sh
#环境检查安装
# 安装 PaddleSpeech
echo "检查是否安装 PaddleSpeech"
if [ ! -d "/home/sysadmin/aistudio/PaddleSpeech" ];then
# PaddleSpeech 不存在
echo "PaddleSpeech 不存在,从bos下载PaddleSpeech"
cd /home/sysadmin/aistudio \
&& wget https://paddlespeech.bj.bcebos.com/demos/speech_web/PaddleSpeech.zip \
&& unzip PaddleSpeech.zip \
&& rm PaddleSpeech.zip
else
echo "PaddleSpeech exits"
fi
echo "检查是否安装 nltk依赖"
# 下载 nltk 依赖
if [ ! -d "/home/sysadmin/aistudio/nltk_data" ];then
echo "nltk_data 不存在,从bos下载 nltk_data"
cd /home/sysadmin/aistudio \
&& wget https://paddlespeech.bj.bcebos.com/Parakeet/tools/nltk_data.tar.gz \
&& tar zxvf nltk_data.tar.gz \
&& rm nltk_data.tar.gz
else
echo "nltk_data exits"
fi
echo "删除死链"
# 删除死链f
find -L /home/sysadmin/aistudio -type l -delete
echo "pip 安装依赖库"
# pip 安装依赖库
cd /home/sysadmin/aistudio/PaddleSpeech \
&& pip install pytest-runner -i https://mirror.baidu.com/pypi/simple \
&& pip install . -i https://mirror.baidu.com/pypi/simple \
&& pip install paddlespeech-ctcdecoders -i https://mirror.baidu.com/pypi/simple \
&& pip install uvicorn==0.18.3 -i https://mirror.baidu.com/pypi/simple
echo "下载预训练模型"
# 下载预训练模型
if [ ! -d "/home/sysadmin/aistudio/.paddlespeech/models" ];then
if [ -f "/home/sysadmin/aistudio/data/data180142/paddlespeech_env.zip" ];then
# 存在挂载数据集
echo "36 存在挂载环境,复制环境数据"
cd /home/sysadmin/aistudio/data/data180142 \
&& unzip paddlespeech_env.zip \
&& mkdir -p /home/sysadmin/aistudio/.paddlespeech \
&& mv conf /home/sysadmin/aistudio/.paddlespeech \
&& mv datasets /home/sysadmin/aistudio/.paddlespeech \
&& mv models /home/sysadmin/aistudio/.paddlespeech
else
# 不存在挂载数据集
echo "不存在挂载环境,从bos下载 .paddlespeech 预训练模型"
paddlespeech tts --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav \
&& paddlespeech asr --lang zh --input output.wav --yes \
&& rm output.wav
fi
else
echo "paddlespeech 预训练模型已下载"
fi
echo "创建目录"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& mkdir -p tools/aligner \
&& mkdir -p input \
&& mkdir -p pretrained_models \
&& mkdir -p /home/sysadmin/aistudio/work/exp_demo/dump
echo "拷贝压缩包"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/zips/aishell3_model.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner/aishell3_model.zip \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/zips/csmsc_mini.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/input/csmsc_mini.zip \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/zips/fastspeech2_aishell3_ckpt_1.1.0.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/pretrained_models/fastspeech2_aishell3_ckpt_1.1.0.zip \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/zips/hifigan_aishell3_ckpt_0.2.0.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/pretrained_models/hifigan_aishell3_ckpt_0.2.0.zip \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/zips/montreal-forced-aligner_linux.tar.gz /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/montreal-forced-aligner_linux.tar.gz \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/zips/vctk_model.zip /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/vctk_model.zip
echo "配置 MFA 环境"
# 配置 MFA 环境
echo "开始配置 tools 环境"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools \
&& tar xvf montreal-forced-aligner_linux.tar.gz \
&& cp montreal-forced-aligner/lib/libpython3.6m.so.1.0 montreal-forced-aligner/lib/libpython3.6m.so \
&& cd montreal-forced-aligner/lib \
&& ln -snf libpython3.6m.so.1.0 libpython3.6m.so \
&& cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner \
&& cp /home/sysadmin/aistudio/tts3_bak/tools/aligner/simple.lexicon ./
echo "下载微调需要的训练模型"
# 下载微调需要的训练模型
if [ ! -d "/home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models" ];then
if [ -f "/home/sysadmin/aistudio/data/data180142/models.zip" ];then
# 存在挂载数据集
echo "74 存在挂载环境,复制环境数据"
cd /home/sysadmin/aistudio/data/data180142 \
&& unzip models.zip \
&& mkdir -p /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv fastspeech2_mix_ckpt_1.2.0 /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv hifigan_aishell3_static_1.1.0 /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv pwgan_aishell3_static_1.1.0 /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv wavernn_csmsc_static_0.2.0 /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models
else
# 未挂载数据集
echo "不存在挂载环境,从bos下载微调模型,从tt3_bak复制"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& mkdir models \
&& cd models \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/fastspeech2_aishell3_ckpt_1.1.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/fastspeech2_mix_ckpt_1.2.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/fastspeech2_vctk_ckpt_1.2.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/hifigan_aishell3_ckpt_0.2.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/hifigan_aishell3_static_1.1.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/hifigan_vctk_ckpt_0.2.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/pwgan_aishell3_static_1.1.0 ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/models/wavernn_csmsc_static_0.2.0 ./
fi
else
echo "预训练模型下载完成"
fi
echo "input目录文件拷贝"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/input \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/input/csmsc_mini ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/input/ljspeech_mini ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/input/SSB0005_mini ./
echo "解压缩"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/ \
&& unzip vctk_model.zip
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner/ \
&& unzip aishell3_model.zip
echo "拷贝文件"
cd /home/sysadmin/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/vctk_model ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/cmudict-0.7b ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/simple.lexicon ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/cmudict-0.7b ./tools/aligner/cmudict-0.7b \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/simple.lexicon ./tools/aligner/simple.lexicon \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/vctk_model/meta.yaml ./vctk_model/meta.yaml \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/tools/aligner/aishell3_model/meta.yaml ./tools/aligner/aishell3_model/meta.yaml
echo "安装依赖包"
#python3.9 -m pip install streamlit
#python3.9 -m pip install typeguard==2.13.3
#sudo apt-get install libbz2-dev
#sudo apt-get install liblzma-dev -y
#sudo apt-get install ffmpeg
#python3.9 -m pip install psutil
#sudo add-apt-repository ppa:ubuntu-toolchain-r/test
#sudo apt-get update
#sudo apt-get install gcc-4.9
#sudo apt-get upgrade libstdc++6
#此处speaker_id_map.txt和phone_id_map.txt所在的exp_demo目录根据模型名称调整,我的模型名称为demo
echo "拷贝代码"
cd /home/sysadmin/aistudio \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/codes/createmodule.py ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/codes/util ./ \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/codes/speaker_id_map.txt /home/sysadmin/aistudio/work/exp_demo/dump/speaker_id_map.txt \
&& cp -rf /home/sysadmin/aistudio/tts3_bak/codes/phone_id_map.txt /home/sysadmin/aistudio/work/exp_demo/dump/phone_id_map.txt
echo "开始执行模型生成步骤"
cd /home/sysadmin/aistudio
streamlit run createmodule.py
将这个env.sh的shell脚本和tts_bak文件夹上传到ubuntu的aistudio文件夹下即可。
补充:
问:AttributeError: module 'numpy' has no attribute 'complex'.
numpy的版本过高,降低下。
答:
python3.9 -m pip install numpy==1.21.6 -i https://pypi.tuna.tsinghua.edu.cn/simple
问:[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /root/nltk_data... 卡在这里,把aistudio项目里的直接下载或者复制过去,我是复制过去的。
答
cp -r /home/ajb/aistudio/nltk_data/ /root/
问:
./evn.sh的时候,出现git错误,要处理,有环境要下载
答:
sudo apt-get install git
问:zipfile.BadZipFile: File is not a zip file
这是因为 模型包不完整导致的.
答:见nltk_data下载卡,卡导致包下载不完整。
这是我从官网下载的evn.sh
# 安装 PaddleSpeech
if [ ! -d "/home/ajb/aistudio/PaddleSpeech" ];then
# PaddleSpeech 不存在
echo "PaddleSpeech 不存在,从bos下载PaddleSpeech"
cd /home/ajb/aistudio \
&& wget https://paddlespeech.bj.bcebos.com/demos/speech_web/PaddleSpeech.zip \
&& unzip PaddleSpeech.zip \
&& rm PaddleSpeech.zip
else
echo "PaddleSpeech exits"
fi
# 下载 nltk 依赖
if [ ! -d "/home/ajb/aistudio/nltk_data" ];then
echo "nltk_data 不存在,从bos下载 nltk_data"
cd /home/ajb/aistudio \
&& wget https://paddlespeech.bj.bcebos.com/Parakeet/tools/nltk_data.tar.gz \
&& tar zxvf nltk_data.tar.gz \
&& rm nltk_data.tar.gz
else
echo "nltk_data exits"
fi
# 删除死链
find -L /home/ajb/aistudio -type l -delete
# pip 安装依赖库
cd /home/ajb/aistudio/PaddleSpeech \
&& pip install pytest-runner -i https://mirror.baidu.com/pypi/simple \
&& pip install . -i https://mirror.baidu.com/pypi/simple \
&& pip install paddlespeech-ctcdecoders -i https://mirror.baidu.com/pypi/simple \
&& pip install uvicorn==0.18.3 -i https://mirror.baidu.com/pypi/simple
# 下载预训练模型
if [ ! -d "/home/ajb/aistudio/.paddlespeech/models" ];then
if [ -f "/home/ajb/aistudio/data/data180142/paddlespeech_env.zip" ];then
# 存在挂载数据集
echo "36 存在挂载环境,复制环境数据"
cd /home/ajb/aistudio/data/data180142 \
&& unzip paddlespeech_env.zip \
&& mkdir -p /home/ajb/aistudio/.paddlespeech \
&& mv conf /home/ajb/aistudio/.paddlespeech \
&& mv datasets /home/ajb/aistudio/.paddlespeech \
&& mv models /home/ajb/aistudio/.paddlespeech
else
# 不存在挂载数据集
echo "不存在挂载环境,从bos下载 .paddlespeech 预训练模型"
paddlespeech tts --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav \
&& paddlespeech asr --lang zh --input output.wav --yes \
&& rm output.wav
fi
else
echo "paddlespeech 预训练模型已下载"
fi
# 配置 MFA 环境
if [ ! -d "/home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools" ];then
echo "开始配置 tools 环境"
cd /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& mkdir -p tools/aligner \
&& cd tools \
&& cp /home/ajb/aistudio/montreal-forced-aligner_linux.tar.gz ./ \
&& tar xvf montreal-forced-aligner_linux.tar.gz \
&& cd montreal-forced-aligner/lib \
&& ln -snf libpython3.6m.so.1.0 libpython3.6m.so \
&& cd /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner \
&& wget https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/aishell3_model.zip \
&& wget https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/simple.lexicon \
&& unzip aishell3_model.zip
else
echo "第二次开始配置 tools 环境"
cd /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& mkdir -p tools/aligner \
&& cd tools \
&& cp /home/ajb/aistudio/montreal-forced-aligner_linux.tar.gz ./ \
&& tar xvf montreal-forced-aligner_linux.tar.gz \
&& cd montreal-forced-aligner/lib \
&& ln -snf libpython3.6m.so.1.0 libpython3.6m.so \
&& cd /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/tools/aligner \
&& wget https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/aishell3_model.zip \
&& wget https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/simple.lexicon \
&& unzip aishell3_model.zip
echo "MFA 环境已存在"
fi
# 下载微调需要的训练模型
if [ ! -d "/home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models" ];then
if [ -f "/home/ajb/aistudio/data/data180142/models.zip" ];then
# 存在挂载数据集
echo "74 存在挂载环境,复制环境数据"
cd /home/ajb/aistudio/data/data180142 \
&& unzip models.zip \
&& mkdir -p /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv fastspeech2_mix_ckpt_1.2.0 /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv hifigan_aishell3_static_1.1.0 /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv pwgan_aishell3_static_1.1.0 /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models \
&& mv wavernn_csmsc_static_0.2.0 /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/models
else
# 未挂载数据集
echo "不存在挂载环境,从bos下载微调模型"
cd /home/ajb/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 \
&& mkdir models \
&& cd models \
&& wget https://paddlespeech.bj.bcebos.com/t2s/chinse_english_mixed/models/fastspeech2_mix_ckpt_1.2.0.zip \
&& unzip fastspeech2_mix_ckpt_1.2.0.zip \
&& wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/pwgan/pwgan_aishell3_static_1.1.0.zip \
&& unzip pwgan_aishell3_static_1.1.0.zip \
&& wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/hifigan/hifigan_aishell3_static_1.1.0.zip \
&& unzip hifigan_aishell3_static_1.1.0.zip \
&& wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/wavernn/wavernn_csmsc_static_0.2.0.zip \
&& unzip wavernn_csmsc_static_0.2.0.zip
fi
else
echo "预训练模型下载完成"
fi