daniilrobnikov / vits2

VITS2: Improving Quality and Efficiency of Single-Stage Text-to-Speech with Adversarial Learning and Architecture Design
https://vits-2.github.io/demo/
MIT License
502 stars 53 forks source link

n_speakers > 0 有问题啊兄弟 #2

Open wlz987 opened 1 year ago

wlz987 commented 1 year ago

n_speakers > 0 has problem

daniilrobnikov commented 1 year ago

Hi @longzewei ! Thanks for addressing the issue. Can you elaborate on the problem you've faced

Also, the code was updated recently, so consider to use the new version

wlz987 commented 1 year ago

config.txt Traceback (most recent call last): File "/home/work/语音相关/文字转语音/vits2/train_ms.py", line 224, in main() File "/home/work/语音相关/文字转语音/vits2/train_ms.py", line 39, in main mp.spawn( File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 239, in spawn return start_processes(fn, args, nprocs, join, daemon, start_method='spawn') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 197, in start_processes while not context.join(): ^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 160, in join raise ProcessRaisedException(msg, error_index, failed_process.pid) torch.multiprocessing.spawn.ProcessRaisedException:

-- Process 0 terminated with the following error: Traceback (most recent call last): File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap fn(i, args) File "/home/work/语音相关/文字转语音/vits2/train_ms.py", line 92, in run train_and_evaluate(rank, epoch, hps, [net_g, net_d], [optim_g, optim_d], [scheduler_g, scheduler_d], scaler, [train_loader, eval_loader], logger, [writer, writer_eval]) File "/home/work/语音相关/文字转语音/vits2/train_ms.py", line 124, in train_and_evaluate y_hat, l_length, attn, ids_slice, x_mask, z_mask, (z, z_p, m_p, logs_p, m_q, logs_q) = net_g(x, x_lengths, spec, spec_lengths, speakers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1156, in forward output = self._run_ddp_forward(*inputs, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1110, in _run_ddp_forward return module_to_run(inputs[0], kwargs[0]) # type: ignore[index] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/语音相关/文字转语音/vits2/model/models.py", line 72, in forward z, m_q, logs_q, y_mask = self.enc_q(y, y_lengths, g=g) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/语音相关/文字转语音/vits2/model/encoders.py", line 121, in forward x = self.enc(x, x_mask, g=g) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/work/语音相关/文字转语音/vits2/model/modules.py", line 47, in forward g = self.cond_layer(g.mT).mT ^^^^^^^^^^^^^^^ File "/home/work/miniconda3/envs/vits2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1614, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'WN' object has no attribute 'cond_layer'

daniilrobnikov commented 1 year ago

Hi, @wlz987 ! I checked multi-speaker training and it works fine.

I updated the code recently, so try to run the newer version.

If there any further problems, feel free to open an issue