在demo数据集上微调PaddleSpeech

背景

在centos7 (CentOS Linux release 7.6.1810 (Core))下,git clone paddlespeech项目,checkout r1.4.1,并安装微调中文环境,进行微调。

微调PaddleSpeech遇到的This dataset has no examples与解决。

安装

conda环境

在这里插入图片描述

#speech
#create conda enviroment

conda create -n speech python=3.10


#install package

pip install -r requirements.txt  -i https://mirror.baidu.com/pypi/simple/ --trusted-host mirror.baidu.com

requirements.txt

bashnumpy==1.23.5
paddlespeech_ctcdecoders
paddlepaddle==2.4.2
pytest-runner
paddlespeech
ipykernel
transformers

微调环境

参照clone下来的项目中的paddlespeech/examples/other/tts/README.md,搭建环境,具体的:
注:以下操作的根目录在paddlespeech/examples/other/tts/

下载预训练模型(如下是下载合成中文的)

mkdir -p pretrained_models && cd pretrained_models

预训练的fastspeech2模型

wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/fastspeech2/fastspeech2_aishell3_ckpt_1.1.0.zip 

unzip fastspeech2_aishell3_ckpt_1.1.0.zip

预训练的hifigan 模型

wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/hifigan/hifigan_aishell3_ckpt_0.2.0.zip
unzip hifigan_aishell3_ckpt_0.2.0.zip
cd ../

准备数据(这里将数据放在input下,如下使用了csmsc的200个数据集)

下载后解压后,有200个wav和lables.txt文件。
标签文件的格式是:utt_id|pronunciation
比如:
000001|ka2 er2 pu3 pei2 wai4 sun1 wan2 hua2 ti1

mkdir -p input && cd input

wget https://paddlespeech.bj.bcebos.com/datasets/csmsc_mini.zip

unzip csmsc_mini.zip

下载MFA 一个语音对齐工具和模型

工具

mkdir -p tools && cd tools

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

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 ../../

以上准备好后,目录如下:
在这里插入图片描述

运行微调

根据需要调整conf/finetune.yaml

./run.sh
在这里插入图片描述

FAQ

问题

以上在运行run.sh的时候,报错This dataset has no examples
在这里插入图片描述
在这里插入图片描述

(speech) [datatech@join71 tts3]$ ./run.sh
check oov
get mfa result
align.py:60: YAMLLoadWarning: calling yaml.load() without Loader=… is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
Setting up corpus information…
Number of speakers in corpus: 1, average number of utterances per speaker: 198.0
/home/datatech/proj/paddlespeech/examples/other/tts_finetune/tts3/tools/montreal-forced-aligner/lib/aligner/models.py:87: YAMLLoadWarning: calling yaml.load() without Loader=… is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
Creating dictionary information…
Using previous MFCCs
Number of speakers in corpus: 1, average number of utterances per speaker: 198.0
Done with setup.
100%|###########################################################################################################################| 2/2 [00:01<00:00, 1.05it/s]
Done! Everything took 2.914034843444824 seconds
generate durations.txt
extract feature
/home/datatech/anaconda3/envs/speech/lib/python3.10/site-packages/setuptools/sandbox.py:13: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
/home/datatech/anaconda3/envs/speech/lib/python3.10/site-packages/pkg_resources/init.py:2871: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/home/datatech/anaconda3/envs/speech/lib/python3.10/site-packages/pkg_resources/init.py:2871: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/home/datatech/anaconda3/envs/speech/lib/python3.10/site-packages/librosa/core/constantq.py:1059: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
dtype=np.complex,
196 1
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 196/196 [00:00<00:00, 25790.86it/s]
Done
Traceback (most recent call last):
File “/home/datatech/proj/paddlespeech/examples/other/tts_finetune/tts3/local/extract_feature.py”, line 346, in
extract_feature(
File “/home/datatech/proj/paddlespeech/examples/other/tts_finetune/tts3/local/extract_feature.py”, line 266, in extract_feature
normalize(speech_scaler, pitch_scaler, energy_scaler, vocab_phones,
File “/home/datatech/proj/paddlespeech/examples/other/tts_finetune/tts3/local/extract_feature.py”, line 155, in normalize
dataset = DataTable(
File “/home/datatech/proj/paddlespeech/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

解决

将MFA下的如下so文件删掉或者mv成别的文件

paddlespeech/examples/other/tts_finetune/tts3/tools/montreal-forced-aligner/lib/thirdparty/bin/libopenblas.so.0

安装

yum install openblas
### 回答1: ua v123数据集demo是针对计算机视觉领域的一个开源数据集,其中包含了多张人体图像以及其对应的身体关键点位置信息。该数据集demo可用于训练和测试人体姿态估计、行人检测、行人重识别等计算机视觉算法的效果。 ua v123数据集demo中的数据来自于不同的场景,包括室内、室外、复杂背景等,具有一定的丰富性和广泛性。同时,该数据集demo还提供了一些实用的工具和接口,方便用户进行数据预处理、训练和测试等操作,提高算法的效率和准确率。 可以说,使用ua v123数据集demo进行人体姿态估计等计算机视觉任务的研究具有一定的实用价值和研究价值。因此,该数据集demo对于计算机视觉领域的学者和科研工作者来说是非常重要的资源之一。 ### 回答2: UAV123数据集是用于无人机(UAV)跟踪研究的视频数据集,它是从无人机飞行中捕捉到的图像中提取出来的。该数据集主要包含120个视频序列,其中100个序列用于训练,20个序列用于测试。除此之外,该数据集还提供了目标跟踪的注释数据,使得该数据集成为了研究跟踪算法的重要资源。 在UAV123数据集的使用方面,我们可以利用该数据集来评估不同目标跟踪算法在UAV跟踪方面的性能。同时,我们还可以通过UAV123数据集来对现有算法进行改进,以提高其在UAV跟踪任务中的精度和效率。 针对UAV123数据集DEMO,我们可以通过该DEMO来了解UAV123数据集的特点和使用方法。该DEMO主要包括以下内容:数据集的介绍、数据集下载、数据集标注、目标检测和跟踪算法评估等。通过该DEMO,我们可以了解到该数据集的详细信息,并掌握如何使用该数据集来进行目标跟踪研究。 总的来说,UAV123数据集DEMO是一个非常有价值的资源,它为UAV跟踪算法的研究和评估提供了重要的支持和帮助。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wengad

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值