之前的问题我自己解决了,就是在文本里少打了个空格。
现在到最后一步了,又出现一个问题,我用MockingBird社区分享的模型训练报错,提示我模型和代码版本不一致,我该怎么修改版本?
这是模型名字,名字可能就是版本:pretrained-11-7-21_75k.pt
还有,我想用GPU训练,但是现在默认是CPU训练
Microsoft Windows [版本 10.0.19045.2965]
(c) Microsoft Corporation。保留所有权利。
H:\MockingBird>python pre.py H:\制作数据集 -d aidatatang_200zh -n 7
Using data from:
H:\制作数据集\aidatatang_200zh\corpus\train
aidatatang_200zh: 100%|████████████████████████████████████████████████████████████| 1/1 [00:48<00:00, 48.27s/speakers]
The dataset consists of 283 utterances, 70584 mel frames, 14084160 audio timesteps (0.24 hours).
Max input length (text chars): 226
Max mel frames length: 833
Max audio timesteps length: 166560
Embedding: 0%| | 0/283 [00:00<?, ?utterances/s]Loaded encoder "pretrained.pt" trained to step 1594501
Embedding: 100%|█████████████████████████████████████████████████████████████| 283/283 [00:09<00:00, 29.04utterances/s]
H:\MockingBird>python synthesizer_train.py xiyuetest H:\制作数据集\SV2TTS\synthesizer
Arguments:
run_id: xiyuetest
syn_dir: H:\制作数据集\SV2TTS\synthesizer
models_dir: synthesizer/saved_models/
save_every: 1000
backup_every: 25000
log_every: 200
force_restart: False
hparams:
Checkpoint path: synthesizer\saved_models\xiyuetest\xiyuetest.pt
Loading training data from: H:\制作数据集\SV2TTS\synthesizer\train.txt
Using model: Tacotron
Using device: cpu
Initialising Tacotron Model...
Trainable Parameters: 32.869M
Loading weights at synthesizer\saved_models\xiyuetest\xiyuetest.pt
Tacotron weights loaded from step 75000
Using inputs from:
H:\制作数据集\SV2TTS\synthesizer\train.txt
H:\制作数据集\SV2TTS\synthesizer\mels
H:\制作数据集\SV2TTS\synthesizer\embeds
Found 283 samples
+----------------+------------+---------------+------------------+
| Steps with r=2 | Batch Size | Learning Rate | Outputs/Step (r) |
+----------------+------------+---------------+------------------+
| 85k Steps | 12 | 5e-06 | 2 |
+----------------+------------+---------------+------------------+
H:\MockingBird\synthesizer\synthesizer_dataset.py:84: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ..\torch\csrc\utils\tensor_new.cpp:248.)
embeds = torch.tensor(embeds)
H:\MockingBird\synthesizer\synthesizer_dataset.py:84: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ..\torch\csrc\utils\tensor_new.cpp:248.)
embeds = torch.tensor(embeds)
Traceback (most recent call last):
File "H:\MockingBird\synthesizer_train.py", line 37, in <module>
train(**vars(args))
File "H:\MockingBird\synthesizer\train.py", line 208, in train
optimizer.step()
File "C:\Users\Administrator.DESKTOP-6GOULRD\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\optim\optimizer.py", line 280, in wrapper
out = func(*args, **kwargs)
File "C:\Users\Administrator.DESKTOP-6GOULRD\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\optim\optimizer.py", line 33, in _use_grad
ret = func(self, *args, **kwargs)
File "C:\Users\Administrator.DESKTOP-6GOULRD\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\optim\adam.py", line 141, in step
adam(
File "C:\Users\Administrator.DESKTOP-6GOULRD\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\optim\adam.py", line 281, in adam
func(params,
File "C:\Users\Administrator.DESKTOP-6GOULRD\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\optim\adam.py", line 344, in _single_tensor_adam
exp_avg.mul_(beta1).add_(grad, alpha=1 - beta1)
RuntimeError: The size of tensor a (1024) must match the size of tensor b (3) at non-singleton dimension 3
H:\MockingBird>