民谣女神唱流行,基于AI人工智能so-vits库训练自己的音色模型(叶蓓/Python3.10)
流行天后孙燕姿的音色固然是极好的,但是目前全网都是她的声音复刻,听多了难免会有些审美疲劳,在网络上检索了一圈,还没有发现民谣歌手的音色模型,人就是这样,得不到的永远在骚动,本次我们自己构建训练集,来打造自己的音色模型,让民谣女神来唱流行歌曲,要多带劲就有多带劲。
构建训练集
训练集是指用于训练神经网络模型的数据集合。这个数据集通常由大量的输入和对应的输出组成,神经网络模型通过学习输入和输出之间的关系来进行训练,并且在训练过程中调整模型的参数以最小化误差。
通俗地讲,如果我们想要训练民谣歌手叶蓓的音色模型,就需要将她的歌曲作为输入参数,也就是训练集,训练集的作用是为模型提供学习的材料,使其能够从输入数据中学习到正确的输出。通过反复迭代训练集,神经网络模型可以不断地优化自身,提高其对输入数据的预测能力。
没错,so-vits库底层就是神经网络架构,而训练音色模型库,本质上解决的是预测问题,关于神经网络架构,请移步:人工智能机器学习底层原理剖析,人造神经元,您一定能看懂,通俗解释把AI“黑话”转化为“白话文”,这里不再赘述。
选择训练集样本时,最好选择具有歌手音色“特质”的歌曲,为什么全网都是孙燕姿?只是因为她的音色辨识度太高,模型可以从输入数据中更容易地学习到正确的输出。
此外,训练集数据贵精不贵多,特征权重比较高的清晰样本,在训练效果要比低质量样本要好,比如歌手“翻唱”的一些歌曲,或者使用非常规唱法的歌曲,这类样本虽然也具备一些歌手的音色特征,但对于模型训练来说,实际上起到是反作用,这是需要注意的事情。
这里选择叶蓓早期专辑《幸福深处》中的六首歌:
通常来说,训练集的数量越多,模型的性能就越好,但是在实践中,需要根据实际情况进行权衡和选择。
在深度学习中,通常需要大量的数据才能训练出高性能的模型。例如,在计算机视觉任务中,需要大量的图像数据来训练卷积神经网络模型。但是,在其他一些任务中,如语音识别和自然语言处理,相对较少的数据量也可以训练出高性能的模型。
通常,需要确保训练集中包含充足、多样的样本,以覆盖所有可能的输入情况。此外,训练集中需要包含足够的正样本和负样本,以保证模型的分类性能。
除了数量之外,训练集的质量也非常重要。需要确保训练集中不存在偏差和噪声,同时需要进行数据清洗和数据增强等预处理操作,以提高训练集的质量和多样性。
总的来说,训练集的数量要求需要根据具体问题进行调整,需要考虑问题的复杂性、数据的多样性、模型的复杂度和训练算法的效率等因素。在实践中,需要进行实验和验证,找到最适合问题的训练集规模。
综上,考虑到笔者的电脑配置以及训练时间成本,训练集相对较小,其他朋友可以根据自己的情况丰俭由己地进行调整。
训练集数据清洗
准备好训练集之后,我们需要对数据进行“清洗”,也就是去掉歌曲中的伴奏、停顿以及混音部分,只留下“清唱”的版本。
伴奏和人声分离推荐使用spleeter库:
pip3 install spleeter --user
接着运行命令,对训练集歌曲进行分离操作:
spleeter separate -o d:/output/ -p spleeter:2stems d:/数据.mp3
这里-o代表输出目录,-p代表选择的分离模型,最后是要分离的素材。
首次运行会比较慢,因为spleeter会下载预训练模型,体积在1.73g左右,运行完毕后,会在输出目录生成分离后的音轨文件:
D:\歌曲制作\清唱 的目录
2023/05/11 15:38 <DIR> .
2023/05/11 13:45 <DIR> ..
2023/05/11 13:40 39,651,884 1_1_01. wxs.wav
2023/05/11 15:34 46,103,084 1_1_02. qad_(Vocals)_(Vocals).wav
2023/05/11 15:35 43,802,924 1_1_03. hs_(Vocals)_(Vocals).wav
2023/05/11 15:36 39,054,764 1_1_04. hope_(Vocals)_(Vocals).wav
2023/05/11 15:36 32,849,324 1_1_05. kamen_(Vocals)_(Vocals).wav
2023/05/11 15:37 50,741,804 1_1_06. ctrl_(Vocals)_(Vocals).wav
6 个文件 252,203,784 字节
2 个目录 449,446,780,928 可用字节
关于spleeter更多的操作,请移步至:人工智能AI库Spleeter免费人声和背景音乐分离实践(Python3.10), 这里不再赘述。
分离后的数据样本还需要二次处理,因为分离后的音频本身还会带有一些轻微的背景音和混音,这里推荐使用noisereduce库:
pip3 install noisereduce,soundfile
随后进行降噪处理:
import noisereduce as nr
import soundfile as sf
# 读入音频文件
data, rate = sf.read("audio_file.wav")
# 获取噪声样本
noisy_part = data[10000:15000]
# 估算噪声
noise = nr.estimate_noise(noisy_part, rate)
# 应用降噪算法
reduced_noise = nr.reduce_noise(audio_clip=data, noise_clip=noise, verbose=False)
# 将结果写入文件
sf.write("audio_file_denoised.wav", reduced_noise, rate)
先通过soundfile库将歌曲文件读出来,然后获取噪声样本并对其使用降噪算法,最后写入新文件。
至此,数据清洗工作基本完成。
训练集数据切分
深度学习过程中,计算机会把训练数据读入显卡的缓存中,但如果训练集数据过大,会导致内存溢出问题,也就是常说的“爆显存”现象。
将数据集分成多个部分,每次只载入一个部分的数据进行训练。这种方法可以减少内存使用,同时也可以实现并行处理,提高训练效率。
这里可以使用github.com/openvpi/audio-slicer库:
git clone https://github.com/openvpi/audio-slicer.git
随后编写代码:
import librosa # Optional. Use any library you like to read audio files.
import soundfile # Optional. Use any library you like to write audio files.
from slicer2 import Slicer
audio, sr = librosa.load('example.wav', sr=None, mono=False) # Load an audio file with librosa.
slicer = Slicer(
sr=sr,
threshold=-40,
min_length=5000,
min_interval=300,
hop_size=10,
max_sil_kept=500
)
chunks = slicer.slice(audio)
for i, chunk in enumerate(chunks):
if len(chunk.shape) > 1:
chunk = chunk.T # Swap axes if the audio is stereo.
soundfile.write(f'clips/example_{i}.wav', chunk, sr) # Save sliced audio files with soundfile.
该脚本可以将所有降噪后的清唱样本切成小样本,方便训练,电脑配置比较低的朋友,可以考虑将min_interval和max_sil_kept调的更高一些,这些会切的更碎,所谓“细细切做臊子”。
最后,六首歌被切成了140个小样本:
D:\歌曲制作\slicer 的目录
2023/05/11 15:45 <DIR> .
2023/05/11 13:45 <DIR> ..
2023/05/11 15:45 873,224 1_1_01. wxs_0.wav
2023/05/11 15:45 934,964 1_1_01. wxs_1.wav
2023/05/11 15:45 1,039,040 1_1_01. wxs_10.wav
2023/05/11 15:45 1,391,840 1_1_01. wxs_11.wav
2023/05/11 15:45 2,272,076 1_1_01. wxs_12.wav
2023/05/11 15:45 2,637,224 1_1_01. wxs_13.wav
2023/05/11 15:45 1,476,512 1_1_01. wxs_14.wav
2023/05/11 15:45 1,044,332 1_1_01. wxs_15.wav
2023/05/11 15:45 1,809,908 1_1_01. wxs_16.wav
2023/05/11 15:45 887,336 1_1_01. wxs_17.wav
2023/05/11 15:45 952,604 1_1_01. wxs_18.wav
2023/05/11 15:45 989,648 1_1_01. wxs_19.wav
2023/05/11 15:45 957,896 1_1_01. wxs_2.wav
2023/05/11 15:45 231,128 1_1_01. wxs_20.wav
2023/05/11 15:45 1,337,156 1_1_01. wxs_3.wav
2023/05/11 15:45 1,308,932 1_1_01. wxs_4.wav
2023/05/11 15:45 1,035,512 1_1_01. wxs_5.wav
2023/05/11 15:45 2,388,500 1_1_01. wxs_6.wav
2023/05/11 15:45 2,952,980 1_1_01. wxs_7.wav
2023/05/11 15:45 929,672 1_1_01. wxs_8.wav
2023/05/11 15:45 878,516 1_1_01. wxs_9.wav
2023/05/11 15:45 963,188 1_1_02. qad_(Vocals)_(Vocals)_0.wav
2023/05/11 15:45 901,448 1_1_02. qad_(Vocals)_(Vocals)_1.wav
2023/05/11 15:45 1,411,244 1_1_02. qad_(Vocals)_(Vocals)_10.wav
2023/05/11 15:45 2,070,980 1_1_02. qad_(Vocals)_(Vocals)_11.wav
2023/05/11 15:45 2,898,296 1_1_02. qad_(Vocals)_(Vocals)_12.wav
2023/05/11 15:45 885,572 1_1_02. qad_(Vocals)_(Vocals)_13.wav
2023/05/11 15:45 841,472 1_1_02. qad_(Vocals)_(Vocals)_14.wav
2023/05/11 15:45 876,752 1_1_02. qad_(Vocals)_(Vocals)_15.wav
2023/05/11 15:45 1,091,960 1_1_02. qad_(Vocals)_(Vocals)_16.wav
2023/05/11 15:45 1,188,980 1_1_02. qad_(Vocals)_(Vocals)_17.wav
2023/05/11 15:45 1,446,524 1_1_02. qad_(Vocals)_(Vocals)_18.wav
2023/05/11 15:45 924,380 1_1_02. qad_(Vocals)_(Vocals)_19.wav
2023/05/11 15:45 255,824 1_1_02. qad_(Vocals)_(Vocals)_2.wav
2023/05/11 15:45 1,718,180 1_1_02. qad_(Vocals)_(Vocals)_20.wav
2023/05/11 15:45 2,070,980 1_1_02. qad_(Vocals)_(Vocals)_21.wav
2023/05/11 15:45 2,827,736 1_1_02. qad_(Vocals)_(Vocals)_22.wav
2023/05/11 15:45 862,640 1_1_02. qad_(Vocals)_(Vocals)_23.wav
2023/05/11 15:45 1,628,216 1_1_02. qad_(Vocals)_(Vocals)_24.wav
2023/05/11 15:45 1,626,452 1_1_02. qad_(Vocals)_(Vocals)_25.wav
2023/05/11 15:45 1,499,444 1_1_02. qad_(Vocals)_(Vocals)_26.wav
2023/05/11 15:45 1,303,640 1_1_02. qad_(Vocals)_(Vocals)_27.wav
2023/05/11 15:45 998,468 1_1_02. qad_(Vocals)_(Vocals)_28.wav
2023/05/11 15:45 781,496 1_1_02. qad_(Vocals)_(Vocals)_3.wav
2023/05/11 15:45 1,368,908 1_1_02. qad_(Vocals)_(Vocals)_4.wav
2023/05/11 15:45 892,628 1_1_02. qad_(Vocals)_(Vocals)_5.wav
2023/05/11 15:45 1,386,548 1_1_02. qad_(Vocals)_(Vocals)_6.wav
2023/05/11 15:45 883,808 1_1_02. qad_(Vocals)_(Vocals)_7.wav
2023/05/11 15:45 952,604 1_1_02. qad_(Vocals)_(Vocals)_8.wav
2023/05/11 15:45 1,303,640 1_1_02. qad_(Vocals)_(Vocals)_9.wav
2023/05/11 15:45 1,354,796 1_1_03. hs_(Vocals)_(Vocals)_0.wav
2023/05/11 15:45 1,344,212 1_1_03. hs_(Vocals)_(Vocals)_1.wav
2023/05/11 15:45 1,305,404 1_1_03. hs_(Vocals)_(Vocals)_10.wav
2023/05/11 15:45 1,291,292 1_1_03. hs_(Vocals)_(Vocals)_11.wav
2023/05/11 15:45 1,338,920 1_1_03. hs_(Vocals)_(Vocals)_12.wav
2023/05/11 15:45 1,093,724 1_1_03. hs_(Vocals)_(Vocals)_13.wav
2023/05/11 15:45 1,375,964 1_1_03. hs_(Vocals)_(Vocals)_14.wav
2023/05/11 15:45 1,409,480 1_1_03. hs_(Vocals)_(Vocals)_15.wav
2023/05/11 15:45 1,481,804 1_1_03. hs_(Vocals)_(Vocals)_16.wav
2023/05/11 15:45 2,247,380 1_1_03. hs_(Vocals)_(Vocals)_17.wav
2023/05/11 15:45 1,312,460 1_1_03. hs_(Vocals)_(Vocals)_18.wav
2023/05/11 15:45 1,428,884 1_1_03. hs_(Vocals)_(Vocals)_19.wav
2023/05/11 15:45 1,051,388 1_1_03. hs_(Vocals)_(Vocals)_2.wav
2023/05/11 15:45 1,377,728 1_1_03. hs_(Vocals)_(Vocals)_20.wav
2023/05/11 15:45 1,485,332 1_1_03. hs_(Vocals)_(Vocals)_21.wav
2023/05/11 15:45 897,920 1_1_03. hs_(Vocals)_(Vocals)_22.wav
2023/05/11 15:45 1,591,172 1_1_03. hs_(Vocals)_(Vocals)_23.wav
2023/05/11 15:45 920,852 1_1_03. hs_(Vocals)_(Vocals)_24.wav
2023/05/11 15:45 1,046,096 1_1_03. hs_(Vocals)_(Vocals)_25.wav
2023/05/11 15:45 730,340 1_1_03. hs_(Vocals)_(Vocals)_26.wav
2023/05/11 15:45 1,383,020 1_1_03. hs_(Vocals)_(Vocals)_3.wav
2023/05/11 15:45 1,188,980 1_1_03. hs_(Vocals)_(Vocals)_4.wav
2023/05/11 15:45 1,003,760 1_1_03. hs_(Vocals)_(Vocals)_5.wav
2023/05/11 15:45 1,243,664 1_1_03. hs_(Vocals)_(Vocals)_6.wav
2023/05/11 15:45 845,000 1_1_03. hs_(Vocals)_(Vocals)_7.wav
2023/05/11 15:45 892,628 1_1_03. hs_(Vocals)_(Vocals)_8.wav
2023/05/11 15:45 539,828 1_1_03. hs_(Vocals)_(Vocals)_9.wav
2023/05/11 15:45 725,048 1_1_04. hope_(Vocals)_(Vocals)_0.wav
2023/05/11 15:45 1,023,164 1_1_04. hope_(Vocals)_(Vocals)_1.wav
2023/05/11 15:45 202,904 1_1_04. hope_(Vocals)_(Vocals)_10.wav
2023/05/11 15:45 659,780 1_1_04. hope_(Vocals)_(Vocals)_11.wav
2023/05/11 15:45 1,017,872 1_1_04. hope_(Vocals)_(Vocals)_12.wav
2023/05/11 15:45 1,495,916 1_1_04. hope_(Vocals)_(Vocals)_13.wav
2023/05/11 15:45 1,665,260 1_1_04. hope_(Vocals)_(Vocals)_14.wav
2023/05/11 15:45 675,656 1_1_04. hope_(Vocals)_(Vocals)_15.wav
2023/05/11 15:45 1,187,216 1_1_04. hope_(Vocals)_(Vocals)_16.wav
2023/05/11 15:45 1,201,328 1_1_04. hope_(Vocals)_(Vocals)_17.wav
2023/05/11 15:45 1,368,908 1_1_04. hope_(Vocals)_(Vocals)_18.wav
2023/05/11 15:45 1,462,400 1_1_04. hope_(Vocals)_(Vocals)_19.wav
2023/05/11 15:45 963,188 1_1_04. hope_(Vocals)_(Vocals)_2.wav
2023/05/11 15:45 1,121,948 1_1_04. hope_(Vocals)_(Vocals)_20.wav
2023/05/11 15:45 165,860 1_1_04. hope_(Vocals)_(Vocals)_21.wav
2023/05/11 15:45 1,116,656 1_1_04. hope_(Vocals)_(Vocals)_3.wav
2023/05/11 15:45 622,736 1_1_04. hope_(Vocals)_(Vocals)_4.wav
2023/05/11 15:45 1,349,504 1_1_04. hope_(Vocals)_(Vocals)_5.wav
2023/05/11 15:45 984,356 1_1_04. hope_(Vocals)_(Vocals)_6.wav
2023/05/11 15:45 2,104,496 1_1_04. hope_(Vocals)_(Vocals)_7.wav
2023/05/11 15:45 1,762,280 1_1_04. hope_(Vocals)_(Vocals)_8.wav
2023/05/11 15:45 1,116,656 1_1_04. hope_(Vocals)_(Vocals)_9.wav
2023/05/11 15:45 1,114,892 1_1_05. kamen_(Vocals)_(Vocals)_0.wav
2023/05/11 15:45 874,988 1_1_05. kamen_(Vocals)_(Vocals)_1.wav
2023/05/11 15:45 1,400,660 1_1_05. kamen_(Vocals)_(Vocals)_10.wav
2023/05/11 15:45 943,784 1_1_05. kamen_(Vocals)_(Vocals)_11.wav
2023/05/11 15:45 1,351,268 1_1_05. kamen_(Vocals)_(Vocals)_12.wav
2023/05/11 15:45 1,476,512 1_1_05. kamen_(Vocals)_(Vocals)_13.wav
2023/05/11 15:45 933,200 1_1_05. kamen_(Vocals)_(Vocals)_14.wav
2023/05/11 15:45 1,388,312 1_1_05. kamen_(Vocals)_(Vocals)_15.wav
2023/05/11 15:45 1,012,580 1_1_05. kamen_(Vocals)_(Vocals)_16.wav
2023/05/11 15:45 1,365,380 1_1_05. kamen_(Vocals)_(Vocals)_17.wav
2023/05/11 15:45 1,614,104 1_1_05. kamen_(Vocals)_(Vocals)_18.wav
2023/05/11 15:45 1,582,352 1_1_05. kamen_(Vocals)_(Vocals)_19.wav
2023/05/11 15:45 949,076 1_1_05. kamen_(Vocals)_(Vocals)_2.wav
2023/05/11 15:45 1,402,424 1_1_05. kamen_(Vocals)_(Vocals)_20.wav
2023/05/11 15:45 1,268,360 1_1_05. kamen_(Vocals)_(Vocals)_21.wav
2023/05/11 15:45 1,016,108 1_1_05. kamen_(Vocals)_(Vocals)_22.wav
2023/05/11 15:45 1,065,500 1_1_05. kamen_(Vocals)_(Vocals)_3.wav
2023/05/11 15:45 874,988 1_1_05. kamen_(Vocals)_(Vocals)_4.wav
2023/05/11 15:45 954,368 1_1_05. kamen_(Vocals)_(Vocals)_5.wav
2023/05/11 15:45 1,049,624 1_1_05. kamen_(Vocals)_(Vocals)_6.wav
2023/05/11 15:45 878,516 1_1_05. kamen_(Vocals)_(Vocals)_7.wav
2023/05/11 15:45 1,019,636 1_1_05. kamen_(Vocals)_(Vocals)_8.wav
2023/05/11 15:45 1,383,020 1_1_05. kamen_(Vocals)_(Vocals)_9.wav
2023/05/11 15:45 1,005,524 1_1_06. ctrl_(Vocals)_(Vocals)_0.wav
2023/05/11 15:45 1,090,196 1_1_06. ctrl_(Vocals)_(Vocals)_1.wav
2023/05/11 15:45 84,716 1_1_06. ctrl_(Vocals)_(Vocals)_10.wav
2023/05/11 15:45 857,348 1_1_06. ctrl_(Vocals)_(Vocals)_11.wav
2023/05/11 15:45 991,412 1_1_06. ctrl_(Vocals)_(Vocals)_12.wav
2023/05/11 15:45 1,121,948 1_1_06. ctrl_(Vocals)_(Vocals)_13.wav
2023/05/11 15:45 931,436 1_1_06. ctrl_(Vocals)_(Vocals)_14.wav
2023/05/11 15:45 3,129,380 1_1_06. ctrl_(Vocals)_(Vocals)_15.wav
2023/05/11 15:45 6,202,268 1_1_06. ctrl_(Vocals)_(Vocals)_16.wav
2023/05/11 15:45 1,457,108 1_1_06. ctrl_(Vocals)_(Vocals)_17.wav
2023/05/11 15:45 1,046,096 1_1_06. ctrl_(Vocals)_(Vocals)_2.wav
2023/05/11 15:45 956,132 1_1_06. ctrl_(Vocals)_(Vocals)_3.wav
2023/05/11 15:45 1,286,000 1_1_06. ctrl_(Vocals)_(Vocals)_4.wav
2023/05/11 15:45 804,428 1_1_06. ctrl_(Vocals)_(Vocals)_5.wav
2023/05/11 15:45 1,337,156 1_1_06. ctrl_(Vocals)_(Vocals)_6.wav
2023/05/11 15:45 1,372,436 1_1_06. ctrl_(Vocals)_(Vocals)_7.wav
2023/05/11 15:45 2,954,744 1_1_06. ctrl_(Vocals)_(Vocals)_8.wav
2023/05/11 15:45 6,112,304 1_1_06. ctrl_(Vocals)_(Vocals)_9.wav
140 个文件 183,026,452 字节
至此,数据切分顺利完成。
开始训练
万事俱备,只差训练,首先配置so-vits-svc环境,请移步:AI天后,在线飙歌,人工智能AI孙燕姿模型应用实践,复刻《遥远的歌》,原唱晴子(Python3.10),囿于篇幅,这里不再赘述。
随后将切分后的数据集放在项目根目录的dataset_raw/yebei文件夹,如果没有yebei文件夹,请进行创建。
随后构建训练配置文件:
{
"train": {
"log_interval": 200,
"eval_interval": 800,
"seed": 1234,
"epochs": 10000,
"learning_rate": 0.0001,
"betas": [
0.8,
0.99
],
"eps": 1e-09,
"batch_size": 6,
"fp16_run": false,
"lr_decay": 0.999875,
"segment_size": 10240,
"init_lr_ratio": 1,
"warmup_epochs": 0,
"c_mel": 45,
"c_kl": 1.0,
"use_sr": true,
"max_speclen": 512,
"port": "8001",
"keep_ckpts": 10,
"all_in_mem": false
},
"data": {
"training_files": "filelists/train.txt",
"validation_files": "filelists/val.txt",
"max_wav_value": 32768.0,
"sampling_rate": 44100,
"filter_length": 2048,
"hop_length": 512,
"win_length": 2048,
"n_mel_channels": 80,
"mel_fmin": 0.0,
"mel_fmax": 22050
},
"model": {
"inter_channels": 192,
"hidden_channels": 192,
"filter_channels": 768,
"n_heads": 2,
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0.1,
"resblock": "1",
"resblock_kernel_sizes": [
3,
7,
11
],
"resblock_dilation_sizes": [
[
1,
3,
5
],
[
1,
3,
5
],
[
1,
3,
5
]
],
"upsample_rates": [
8,
8,
2,
2,
2
],
"upsample_initial_channel": 512,
"upsample_kernel_sizes": [
16,
16,
4,
4,
4
],
"n_layers_q": 3,
"use_spectral_norm": false,
"gin_channels": 768,
"ssl_dim": 768,
"n_speakers": 1
},
"spk": {
"yebei": 0
}
}
这里epochs是指对整个训练集进行一次完整的训练。具体来说,每个epoch包含多个训练步骤,每个训练步骤会从训练集中抽取一个小批量的数据进行训练,并更新模型的参数。
需要调整的参数是batch_size,如果显存不够,需要往下调整,否则也会“爆显存”,如果训练过程中出现了下面这个错误:
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 8.00 GiB total capacity; 6.86 GiB already allocated; 0 bytes free; 7.25 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
那么就说明显存已经不够用了。
最后,运行命令开始训练:
python3 train.py -c configs/config.json -m 44k
终端会返回训练过程:
D:\work\so-vits-svc\workenv\lib\site-packages\torch\optim\lr_scheduler.py:139: UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
warnings.warn("Detected call of `lr_scheduler.step()` before `optimizer.step()`. "
D:\work\so-vits-svc\workenv\lib\site-packages\torch\functional.py:641: UserWarning: stft with return_complex=False is deprecated. In a future pytorch release, stft will return complex tensors for all inputs, and return_complex=False will raise an error.
Note: you can still call torch.view_as_real on the complex output to recover the old return format. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\SpectralOps.cpp:867.)
return _VF.stft(input, n_fft, hop_length, win_length, window, # type: ignore[attr-defined]
INFO:torch.nn.parallel.distributed:Reducer buckets have been rebuilt in this iteration.
D:\work\so-vits-svc\workenv\lib\site-packages\torch\autograd\__init__.py:200: UserWarning: Grad strides do not match bucket view strides. This may indicate grad was not created according to the gradient layout contract, or that the param's strides changed since DDP was constructed. This is not an error, but may impair performance.
grad.sizes() = [32, 1, 4], strides() = [4, 1, 1]
bucket_view.sizes() = [32, 1, 4], strides() = [4, 4, 1] (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\distributed\c10d\reducer.cpp:337.)
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
INFO:torch.nn.parallel.distributed:Reducer buckets have been rebuilt in this iteration.
INFO:44k:====> Epoch: 274, cost 39.02 s
INFO:44k:====> Epoch: 275, cost 17.47 s
INFO:44k:====> Epoch: 276, cost 17.74 s
INFO:44k:====> Epoch: 277, cost 17.43 s
INFO:44k:====> Epoch: 278, cost 17.59 s
INFO:44k:====> Epoch: 279, cost 17.82 s
INFO:44k:====> Epoch: 280, cost 17.64 s
INFO:44k:====> Epoch: 281, cost 17.63 s
INFO:44k:Train Epoch: 282 [65%]
INFO:44k:Losses: [1.8697402477264404, 3.029414415359497, 11.415563583374023, 23.37869644165039, 0.2702481746673584], step: 6600, lr: 9.637943809624507e-05, reference_loss: 39.963661193847656
这里每一次Epoch系统都会返回损失函数等相关信息,训练好的模型存放在项目的logs/44k目录下,模型的后缀名是.pth。
结语
一般情况下,训练损失率低于50%,并且损失函数在训练集和验证集上都趋于稳定,则可以认为模型已经收敛。收敛的模型就可以为我们所用了,如何使用训练好的模型,请移步:AI天后,在线飙歌,人工智能AI孙燕姿模型应用实践,复刻《遥远的歌》,原唱晴子(Python3.10)。
最后,奉上民谣女神叶蓓的总训练6400次的音色模型,与众乡亲同飨:
pan.baidu.com/s/1m3VGc7RktaO5snHw6RPLjQ?pwd=pqkb
提取码:pqkb
民谣女神唱流行,基于AI人工智能so-vits库训练自己的音色模型(叶蓓/Python3.10)的更多相关文章
- 影片自由,丝滑流畅,Docker容器基于WebDav协议通过Alist挂载(百度网盘/阿里云盘)Python3.10接入
使用过NAS(Network Attached Storage)的朋友都知道,它可以通过局域网将本地硬盘转换为局域网内的"网盘",简单理解就是搭建自己的"私有云" ...
- 物以类聚人以群分,通过GensimLda文本聚类构建人工智能个性化推荐系统(Python3.10)
众所周知,个性化推荐系统能够根据用户的兴趣.偏好等信息向用户推荐相关内容,使得用户更感兴趣,从而提升用户体验,提高用户粘度,之前我们曾经使用协同过滤算法构建过个性化推荐系统,但基于显式反馈的算法就会有 ...
- 闻其声而知雅意,基于Pytorch(mps/cpu/cuda)的人工智能AI本地语音识别库Whisper(Python3.10)
前文回溯,之前一篇:含辞未吐,声若幽兰,史上最强免费人工智能AI语音合成TTS服务微软Azure(Python3.10接入),利用AI技术将文本合成语音,现在反过来,利用开源库Whisper再将语音转 ...
- 登峰造极,师出造化,Pytorch人工智能AI图像增强框架ControlNet绘画实践,基于Python3.10
人工智能太疯狂,传统劳动力和内容创作平台被AI枪毙,弃尸尘埃.并非空穴来风,也不是危言耸听,人工智能AI图像增强框架ControlNet正在疯狂地改写绘画艺术的发展进程,你问我绘画行业未来的样子?我只 ...
- 好饭不怕晚,Google基于人工智能AI大语言对话模型Bard测试和API调用(Python3.10)
谷歌(Google)作为开源过著名深度学习框架Tensorflow的超级大厂,是人工智能领域一股不可忽视的中坚力量,旗下新产品Bard已经公布测试了一段时间,毁誉参半,很多人把Google的Bard和 ...
- 人工智能AI图像风格迁移(StyleTransfer),基于双层ControlNet(Python3.10)
图像风格迁移(Style Transfer)是一种计算机视觉技术,旨在将一幅图像的风格应用到另一幅图像上,从而生成一幅新图像,该新图像结合了两幅原始图像的特点,目的是达到一种风格化叠加的效果,本次我们 ...
- AI人工智能之基于OpenCV+face_recognition实现人脸识别
因近期公司项目需求,需要从监控视频里识别出人脸信息.OpenCV非常庞大,其中官方提供的人脸模型分类器也可以满足基本的人脸识别,当然我们也可以训练自己的人脸模型数据,但是从精确度和专业程度上讲Open ...
- 《zw版·Halcon-delphi系列原创教程》 Halcon分类函数002·AI人工智能
<zw版·Halcon-delphi系列原创教程> Halcon分类函数002·AI人工智能 AI人工智能:包括knn.gmm.svm等 为方便阅读,在不影响说明的前提下,笔者对函数进行了 ...
- 从大数据技术变迁猜一猜AI人工智能的发展
目前大数据已经成为了各家互联网公司的核心资产和竞争力了,其实不仅是互联网公司,包括传统企业也拥有大量的数据,也想把这些数据发挥出作用.在这种环境下,大数据技术的重要性和火爆程度相信没有人去怀疑. 而A ...
- AI人工智能专业词汇集
作为最早关注人工智能技术的媒体,机器之心在编译国外技术博客.论文.专家观点等内容上已经积累了超过两年多的经验.期间,从无到有,机器之心的编译团队一直在积累专业词汇.虽然有很多的文章因为专业性我们没能尽 ...
随机推荐
- app 好用的手机端开发调试工具插件 vconsole vue3
效果:可以在手机上看控制台的内容 $ npm install vconsole 在main.js里引入 // 添加移动端log查看调试器 import Vconsole from 'vconsole' ...
- Git在使用过程中遇到的一些问题
git默认对文件中的大小写不敏感. 方案1: 通过配置git来达到识别文件大小写的问题.命令如下: git config core.ignorcecase false 缺点:每个仓库都需要修改. 方案 ...
- 三艾云 Kubernetes 集群最佳实践
三艾云 Kubernetes 集群最佳实践 三艾云 Kubernetes 集群最佳实践 容器是 Cloud Native 的基石,它们之间的关系不言而喻.了解容器对于学习 Cloud Native 也 ...
- grpc - 使用
grpc 工具 BloomRPC GRPC - 使用 protobuf 定义protobuf,并将protobuf文件,通过java的plugin打包生成java-grpc相关文件.参照:grpc-p ...
- 利用Intent在两个页面之间进行传值操作的具体实现
不知道为什么,我本来使用的呼声最高的Bundle发送,但是我使用它会显示不出来,由于时间问题,我今天就先不找了,先放一下,先以完成任务为己任哈! 我们都清楚,我们基本上都是用的Intent实现的页面之 ...
- 二进制安装Kubernetes(k8s) v1.21.13 IPv4/IPv6双栈
二进制安装Kubernetes(k8s) v1.21.13 IPv4/IPv6双栈 Kubernetes 开源不易,帮忙点个star,谢谢了 介绍 kubernetes二进制安装 后续尽可能第一时间更 ...
- 使用HTMLform表单操作腾讯云DNS控制台
在使用中经常需要修改DNS记录,或者查询.删除操作.每次都得登录腾讯云控制台,腾讯云比较鸡肋的一点就是需要进行微信扫码登录,每次操作太不方便. 可以使用api接口进行操作腾讯云上的产品.所以使用HTM ...
- WAL模块主要方法简述
Method---wal.go Description func Create(lg *zap.Logger, dirpath string, metadata []byte) (*WAL, erro ...
- Android View的事件分发机制-源码解析
为了更好的研究View的事件转发,我们自定以一个MyButton继承Button,然后把跟事件传播有关的方法进行复写,然后添加上日志: 然后把我们自定义的按钮加到主布局文件中: public clas ...
- 快速搭建一个go语言web后端服务脚手架
快速搭建一个go语言web后端服务脚手架 源码:https://github.com/weloe/go-web-demo web框架使用gin,数据操作使用gorm,访问控制使用casbin 首先添加 ...