Giter Club home page Giter Club logo

bert-vits2-integration-package's People

Contributors

anyacoder avatar artrajz avatar duliangang avatar dyzfromyt avatar eiheigantanhao avatar eltociear avatar faceair avatar fumiama avatar github-actions[bot] avatar innnky avatar isotr0py avatar jiangyuxiaoxiao avatar jsoncode avatar leng-yue avatar litagin02 avatar lvjinhong avatar lzyplayer avatar med1844 avatar minami-su avatar miuzarte avatar narusemioshirakana avatar noisyle avatar oedosoldier avatar pre-commit-ci[bot] avatar ricecakey06 avatar stardust-minus avatar steve235lab avatar thymustw avatar ylzz1997 avatar yyux-1145 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bert-vits2-integration-package's Issues

RuntimeError: The expanded size of the tensor (32) must match the existing size (0) at non-singleton dimension 1. Target sizes: [192, 32]. Tensor sizes: [192, 0]

这个报错是什么原因引起的呀,麻烦作者给指导一下

  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/train_ms.py", line 402, in <module>
    main()
  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/train_ms.py", line 60, in main
    mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 240, in spawn
    return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 198, in start_processes
    while not context.join():
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/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 "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
    fn(i, *args)
  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/train_ms.py", line 193, in run
    train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/train_ms.py", line 231, in train_and_evaluate
    (z, z_p, m_p, logs_p, m_q, logs_q), (hidden_x, logw, logw_) = net_g(x, x_lengths, spec, spec_lengths, speakers, tone, language, bert)
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1008, in forward
    output = self._run_ddp_forward(*inputs, **kwargs)
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 969, in _run_ddp_forward
    return module_to_run(*inputs[0], **kwargs[0])
  File "/data/xxx/miniconda3/envs/tts/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/models.py", line 680, in forward
    z_slice, ids_slice = commons.rand_slice_segments(z, y_lengths, self.segment_size)
  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/commons.py", line 63, in rand_slice_segments
    ret = slice_segments(x, ids_str, segment_size)
  File "/data/xxx/ai_algorithm/tts_demo/Bert-VITS2-Integration-package-main-16/commons.py", line 53, in slice_segments
    ret[i] = x[i, :, idx_str:idx_end]
RuntimeError: The expanded size of the tensor (32) must match the existing size (0) at non-singleton dimension 1.  Target sizes: [192, 32].  Tensor sizes: [192, 0]

开始训练时的新问题 页面文件太小

刚开始用大数据集的时候会和上一位题主一样出现除零错误,那个issues用换小数据集的方法解决后又出现了新的报错
OSError: [WinError 1455] 页面文件太小,无法完成操作。 Error loading "D:\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\lib\cublas64_11.dll" or one of its dependencies.
不知所措QaQ

bert_gen.py报错 huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../bert/chinese-roberta-wwm-ext-large'. Use `repo_type` argument if needed.

如题,已经完成chinese_bert.py 的测试,主函数运行正常,对数据集的清理与重采样也完成
image
image

报错如下
image

_(venv) F:\TTS\Bert-VITS2>python bert_gen.py
0%| | 0/1057 [00:07<?, ?it/s]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "F:\TTS\Bert-VITS2\bert_gen.py", line 34, in process_line
bert = torch.load(bert_path)
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\torch\serialization.py", line 791, in load
with _open_file_like(f, 'rb') as opened_file:
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\torch\serialization.py", line 271, in _open_file_like
return _open_file(name_or_buffer, mode)
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\torch\serialization.py", line 252, in init
super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './dataset/huanglongyidou/vo_LYYCOP001_1905703_itto_29.bert.pt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "F:\TTS\Bert-VITS2\bert_gen.py", line 37, in process_line
bert = get_bert(text, word2ph, language_str, torch.device("cuda:0"))
File "F:\TTS\Bert-VITS2\text_init_.py", line 22, in get_bert
from .chinese_bert import get_bert_feature as zh_bert
File "F:\TTS\Bert-VITS2\text\chinese_bert.py", line 5, in
tokenizer = AutoTokenizer.from_pretrained("../bert/chinese-roberta-wwm-ext-large")
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 686, in from_pretrained
tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 519, in get_tokenizer_config
resolved_config_file = cached_file(
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\transformers\utils\hub.py", line 429, in cached_file
resolved_file = hf_hub_download(
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 110, in _inner_fn
validate_repo_id(arg_value)
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 158, in validate_repo_id
raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../bert/chinese-roberta-wwm-ext-large'. Use repo_type argument if needed.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "F:\TTS\Bert-VITS2\bert_gen.py", line 58, in
for _ in tqdm(pool.imap_unordered(process_line, lines), total=len(lines)):
File "F:\TTS\Bert-VITS2\venv\lib\site-packages\tqdm\std.py", line 1182, in iter
for obj in iterable:
File "C:\Program Files\Python310\lib\multiprocessing\pool.py", line 870, in next
raise value
huggingface_hub.utils.validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '../bert/chinese-roberta-wwm-ext-large'. Use repo_type argument if needed.

加载配置出错

按照步骤设定好实验并投入音频点击加载训练配置出错错误如下

Traceback (most recent call last):
File "F:\Bert-VITS2-Integration-Package.release\2.0.2\Bert-VITS2-Integration-Pack-v2.0.2\manager202.py", line 103, in p0_load_cfg
return p0_status.update(value=current_yml) ,'Success'
AttributeError: 'TextArea' object has no attribute 'update'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\queueing.py", line 456, in call_prediction
output = await route_utils.call_process_api(
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\route_utils.py", line 232, in call_process_api
output = await app.get_blocks().process_api(
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\blocks.py", line 1522, in process_api
result = await self.call_function(
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\blocks.py", line 1144, in call_function
prediction = await anyio.to_thread.run_sync(
File "E:\conda\envs\bert_vist\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "E:\conda\envs\bert_vist\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "E:\conda\envs\bert_vist\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\utils.py", line 673, in wrapper
response = f(*args, **kwargs)
File "F:\Bert-VITS2-Integration-Package.release\2.0.2\Bert-VITS2-Integration-Pack-v2.0.2\manager202.py", line 105, in p0_load_cfg
return p0_status.update(value=current_yml),error
AttributeError: 'TextArea' object has no attribute 'update'
Traceback (most recent call last):
File "F:\Bert-VITS2-Integration-Package.release\2.0.2\Bert-VITS2-Integration-Pack-v2.0.2\manager202.py", line 103, in p0_load_cfg
return p0_status.update(value=current_yml) ,'Success'
AttributeError: 'TextArea' object has no attribute 'update'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\queueing.py", line 456, in call_prediction
output = await route_utils.call_process_api(
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\route_utils.py", line 232, in call_process_api
output = await app.get_blocks().process_api(
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\blocks.py", line 1522, in process_api
result = await self.call_function(
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\blocks.py", line 1144, in call_function
prediction = await anyio.to_thread.run_sync(
File "E:\conda\envs\bert_vist\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "E:\conda\envs\bert_vist\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "E:\conda\envs\bert_vist\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\utils.py", line 673, in wrapper
response = f(*args, **kwargs)
File "F:\Bert-VITS2-Integration-Package.release\2.0.2\Bert-VITS2-Integration-Pack-v2.0.2\manager202.py", line 105, in p0_load_cfg
return p0_status.update(value=current_yml),error
AttributeError: 'TextArea' object has no attribute 'update'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\queueing.py", line 501, in process_events
response = await self.call_prediction(awake_events, batch)
File "E:\conda\envs\bert_vist\lib\site-packages\gradio\queueing.py", line 465, in call_prediction
raise Exception(str(error) if show_error else None) from error
Exception: None

推理长文本失败后的显存占用问题

推理超过512个字符的文本后会报错,然后显存占用一直是99%这个是什么原因啊?而且一直不释放,必须关掉再打开才能重新推理短文本..
文字超了报这个 :
embeddings += position_embeddings
RuntimeError: The size of tensor a (1924) must match the size of tensor b (512) at non-singleton dimension 1
减少到512个字符以下后再次推理报这个:
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 502.00 MiB (GPU 0; 7.93 GiB total capacity; 6.06 GiB already allocated; 291.44 MiB free; 6.96 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

然后查看显存占用就一直这样:7825MiB / 8192MiB 不关闭就不释放~~

训练时显示ModuleNotFoundError: No module named 'monotonic_align.monotonic_align.core'解决后引发的更多错误

你好,
目前我正在尝试自己部属环境,
我在run这个命令时→
python train_ms.py -c ./configs\config.json
他会提示
ModuleNotFoundError: No module named 'monotonic_align.monotonic_align.core'
我用pip安装monotonic_align之后仍然有一样的错误,
需要删除完整包中的monotonic_align才不会报告这个错误,
但继续运行时又显示
ImportError: FFmpeg libraries are not found.Please install FFmpeg.
但我直接在cmd中输入ffmpeg可以看到ffmpeg的版本,且前面的预处理过程也很顺利,
ffmpeg是我自己手动配置的环境变亮,
我的python是3.10,
在一开始安装requirements.txt时有报错,因此我手动按照requirements.txt里面的名字来安装每个包,没有指定版本,
请问这问题该如何解决,谢谢

在算力云上运行 最后一步训练出错

File "train_ms.py", line 58
shutil.copy('./pretrained_models/G_0.pth','./logs/OUTPUT_MODEL/G_0.pth')
^
IndentationError: unexpected indent
root@autodl-container-9e2911833c-f68eb341:~/autodl-tmp/Bert-VITS2-Integration-Package# python train_ms.py -c ./configs/config.json
INFO:OUTPUT_MODEL:{'train': {'log_interval': 10, 'eval_interval': 100, 'seed': 52, 'epochs': 1000, 'learning_rate': 0.00015, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 12, 'fp16_run': False, 'lr_decay': 0.999875, 'segment_size': 16384, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'use_mel_posterior_encoder': False, 'training_files': 'filelists/train.list', 'validation_files': 'filelists/val.list', 'max_wav_value': 32768.0, 'sampling_rate': 44100, 'filter_length': 2048, 'hop_length': 512, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 1, 'cleaned_text': True, 'spk2id': {'acetaffy': 0}}, 'model': {'use_spk_conditioned_encoder': True, 'use_noise_scaled_mas': True, 'use_mel_posterior_encoder': False, 'use_duration_discriminator': True, '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, 8, 2, 2], 'n_layers_q': 3, 'use_spectral_norm': False, 'gin_channels': 256}, 'model_dir': './logs/./OUTPUT_MODEL', 'cont': False}
WARNING:OUTPUT_MODEL:/root/autodl-tmp/Bert-VITS2-Integration-Package is not a git repository, therefore hash value comparison will be ignored.
INFO:torch.distributed.distributed_c10d:Added key: store_based_barrier_key:1 to store for rank: 0
INFO:torch.distributed.distributed_c10d:Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
skipped: 7 , total: 1125
skipped: 0 , total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
256 2
256 2
256 2
256 2
256 2
./logs/./OUTPUT_MODEL/DUR_0.pth
error, norm_1.gamma is not in the checkpoint
error, norm_1.beta is not in the checkpoint
error, norm_2.gamma is not in the checkpoint
error, norm_2.beta is not in the checkpoint
error, cond.weight is not in the checkpoint
error, cond.bias is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs/./OUTPUT_MODEL/DUR_0.pth' (iteration 694)
./logs/./OUTPUT_MODEL/G_0.pth
error, emb_g.weight is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs/./OUTPUT_MODEL/G_0.pth' (iteration 0)
./logs/./OUTPUT_MODEL/D_0.pth
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs/./OUTPUT_MODEL/D_0.pth' (iteration 0)
0it [00:02, ?it/s]
Traceback (most recent call last):
File "train_ms.py", line 402, in
main()
File "train_ms.py", line 60, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 239, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 197, in start_processes
while not context.join():
File "/root/miniconda3/lib/python3.8/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 "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/root/autodl-tmp/Bert-VITS2-Integration-Package/train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "/root/autodl-tmp/Bert-VITS2-Integration-Package/train_ms.py", line 232, in train_and_evaluate
mel = spec_to_mel_torch(
File "/root/autodl-tmp/Bert-VITS2-Integration-Package/mel_processing.py", line 78, in spec_to_mel_torch
mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax)
TypeError: mel() takes 0 positional arguments but 5 were given

报错optimizer.step()和lr_scheduler.step()顺序问题

INFO:OUTPUT_MODEL:====> Epoch: 1
G:\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\optim\lr_scheduler.py:138: 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(). "
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 2
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 3
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 4
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 5
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 6
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 7
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 8
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 9
我不懂代码也没动别的东西啊 就是一直训练来着,最开始我训练成功了两次,之后再训练的时候就出现这个了,重新下载解压还是出现这个,请楼主帮忙看下什么问题 谢谢啦

大佬求解,开始训练 输完训练代码出来的报错

RuntimeError: expand(torch.FloatTensor{[2, 1025, 475]}, size=[2, 1025]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

这个怎么处理?
然后我修正了参数 再次训练,又显示这个报错

G:\Bert-VITS2-Integration-Package>%PYTHON% train_ms.py -c ./configs\config.json
INFO:OUTPUT_MODEL:{'train': {'log_interval': 10, 'eval_interval': 100, 'seed': 52, 'epochs': 1000, 'learning_rate': 0.0002, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 6, 'fp16_run': False, 'lr_decay': 0.999875, 'segment_size': 8384, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'use_mel_posterior_encoder': False, 'training_files': 'filelists/train.list', 'validation_files': 'filelists/val.list', 'max_wav_value': 32768.0, 'sampling_rate': 44100, 'filter_length': 2048, 'hop_length': 512, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 1, 'cleaned_text': True, 'spk2id': {'jeff': 0}}, 'model': {'use_spk_conditioned_encoder': True, 'use_noise_scaled_mas': True, 'use_mel_posterior_encoder': False, 'use_duration_discriminator': True, '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, 8, 2, 2], 'n_layers_q': 3, 'use_spectral_norm': False, 'gin_channels': 256}, 'model_dir': './logs\./OUTPUT_MODEL', 'cont': False}
WARNING:OUTPUT_MODEL:G:\Bert-VITS2-Integration-Package is not a git repository, therefore hash value comparison will be ignored.
INFO:torch.distributed.distributed_c10d:Added key: store_based_barrier_key:1 to store for rank: 0
INFO:torch.distributed.distributed_c10d:Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
skipped: 7 , total: 852
skipped: 0 , total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
256 2
256 2
256 2
256 2
256 2
./logs./OUTPUT_MODEL\DUR_0.pth
error, norm_1.gamma is not in the checkpoint
error, norm_1.beta is not in the checkpoint
error, norm_2.gamma is not in the checkpoint
error, norm_2.beta is not in the checkpoint
error, cond.weight is not in the checkpoint
error, cond.bias is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\DUR_0.pth' (iteration 694)
./logs./OUTPUT_MODEL\G_0.pth
error, emb_g.weight is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\G_0.pth' (iteration 0)
./logs./OUTPUT_MODEL\D_0.pth
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\D_0.pth' (iteration 0)
0it [00:00, ?it/s]G:\Bert-VITS2-Integration-Package\mel_processing.py:78: FutureWarning: Pass sr=44100, n_fft=2048, n_mels=128, fmin=0.0, fmax=None as keyword args. From version 0.10 passing these as positional arguments will result in an error
mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax)
[W C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\distributed\c10d\reducer.cpp:1305] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator ())
0it [00:04, ?it/s]
Traceback (most recent call last):
File "train_ms.py", line 402, in
main()
File "train_ms.py", line 60, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "G:\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "G:\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 198, in start_processes
while not context.join():
File "G:\Bert-VITS2-Integration-Package\venv\lib\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 "G:\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 69, in _wrap
fn(i, *args)
File "G:\Bert-VITS2-Integration-Package\train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "G:\Bert-VITS2-Integration-Package\train_ms.py", line 286, in train_and_evaluate
loss_fm = feature_loss(fmap_r, fmap_g)
File "G:\Bert-VITS2-Integration-Package\losses.py", line 13, in feature_loss
loss += torch.mean(torch.abs(rl - gl))
RuntimeError: The size of tensor a (8384) must match the size of tensor b (8192) at non-singleton dimension 2

最新的整合卡在这个阶段不会动了

F:\Bert-VITS2-Integration-Package>%PYTHON% train_ms.py -c ./configs\config.json
INFO:OUTPUT_MODEL:{'train': {'log_interval': 10, 'eval_interval': 100, 'seed': 52, 'epochs': 1000, 'learning_rate': 0.00
02, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 8, 'fp16_run': False, 'lr_decay': 0.999875, 'segment_size': 16384,
'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'use_mel_posterior_encoder': False, 'traini
ng_files': 'filelists/train.list', 'validation_files': 'filelists/val.list', 'max_wav_value': 32768.0, 'sampling_rate':
44100, 'filter_length': 2048, 'hop_length': 512, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax':
None, 'add_blank': True, 'n_speakers': 1, 'cleaned_text': True, 'spk2id': {'MuelsyseZH': 0}}, 'model': {'use_spk_condit
ioned_encoder': True, 'use_noise_scaled_mas': True, 'use_mel_posterior_encoder': False, 'use_duration_discriminator': Tr
ue, '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, 8,
2, 2], 'n_layers_q': 3, 'use_spectral_norm': False, 'gin_channels': 256}, 'model_dir': './logs\./OUTPUT_MODEL', 'cont'
: False}
WARNING:OUTPUT_MODEL:F:\Bert-VITS2-Integration-Package is not a git repository, therefore hash value comparison will be
ignored.
一直卡在这个阶段是什么问题啊

我是小白,这个项目在linux上能部署吗?弄到最后一步报错了。

python train_ms.py -c ./configs\config.json
Traceback (most recent call last):
File "train_ms.py", line 26, in
from models import (
File "/home/lhuang/Bert-VITS2-Integration-package-main/models.py", line 10, in
import monotonic_align
File "/home/lhuang/Bert-VITS2-Integration-package-main/monotonic_align/init.py", line 3, in
from .monotonic_align.core import maximum_path_c
import monotonic_align
File "/home/lhuang/Bert-VITS2-Integration-package-main/monotonic_align/init.pyc ./configs\config.json", line 3, in
from .monotonic_align.core import maximum_path_c
ModuleNotFoundError: No module named 'monotonic_align.monotonic_align.core'

自动标注报错:Warning: no short audios found

这个错误有可能是因为数据结构不对(文件没放到正确的位置),也有可能是因为ffmpeg没有安装,因为whisper需要ffmpeg。对于后者安装代码已经上传。网盘里有安装包。

RuntimeError: PytorchStreamReader failed reading zip archive: invalid header or archive is corrupted

在mac下推理报这个错误,麻烦作者给指导一下!
在网上查了一下这个错误,说是模型文件每下载完,但是我确定是下载完了的,本地文件大小和服务器模型训练完成保存的文件大小是一模一样的
Traceback (most recent call last):
File "/Users/youbo/PycharmProjects/demo/tts_demo/Bert-VITS2-Integration-package/inference_cmd.py", line 114, in
_ = utils.load_checkpoint(args.model_dir, net_g, None, skip_optimizer=True)
File "/Users/youbo/PycharmProjects/demo/tts_demo/Bert-VITS2-Integration-package/utils.py", line 21, in load_checkpoint
checkpoint_dict = torch.load(checkpoint_path, map_location='cpu')
File "/Users/youbo/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 705, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "/Users/youbo/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 242, in init
super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: invalid header or archive is corrupted

如何开启局域网访问?--listen加了会报错~

首先感谢up大大的制作,想再问一个稍微有些贪心的问题…
之前别的包直接在bat里加入--listen即可监听所有端口,打开的网址也会变成0.0.0.0:7860,如果咱们这个包也想打开局域网访问权限,应该怎么加命令呢?
我只是想用台式机运行,手机或者笔记本在局域网内可以访问就可以了
再次感谢!

训练报错请问是什么原因造成的呢?找了很久找不到问题,能否给一个解决思路!

raceback (most recent call last):
File "train_ms.py", line 402, in
main()
File "train_ms.py", line 60, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 239, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 197, in start_processes
while not context.join():
File "/root/miniconda3/lib/python3.8/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 "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in wrap
fn(i, *args)
File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 231, in train_and_evaluate
(z, z_p, m_p, logs_p, m_q, logs_q), (hidden_x, logw, logw
) = net_g(x, x_lengths, spec, spec_lengths, speakers, tone, language, bert)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 1156, in forward
output = self._run_ddp_forward(*inputs, **kwargs)
File "/root/miniconda3/lib/python3.8/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 "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/Bert-VITS2-Integration-Package/models.py", line 680, in forward
z_slice, ids_slice = commons.rand_slice_segments(z, y_lengths, self.segment_size)
File "/root/Bert-VITS2-Integration-Package/commons.py", line 63, in rand_slice_segments
ret = slice_segments(x, ids_str, segment_size)
File "/root/Bert-VITS2-Integration-Package/commons.py", line 53, in slice_segments
ret[i] = x[i, :, idx_str:idx_end]
RuntimeError: The expanded size of the tensor (32) must match the existing size (0) at non-singleton dimension 1. Target sizes: [192, 32]. Tensor sizes: [192, 0]

第一个字发音不准

从长段音频拆分成短音频作为语料进行训练,会出现第一个字发音不准的问题,其他文字发音都很正常
猜测可能的原因:
1.从长段音频拆分成短音频,可能会在没有断句的地方直接拆分,导致拆分后的最后一个字和下一个句子的第一个字发音不完全
有没有大佬遇到这个问题,请教一下解决方案。

0903的包还是开始训练就报错

D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package>%PYTHON% train_ms.py -c ./configs\config.json
INFO:OUTPUT_MODEL:{'train': {'log_interval': 10, 'eval_interval': 100, 'seed': 52, 'epochs': 1000, 'learning_rate': 0.0002, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 16, 'fp16_run': False, 'lr_decay': 0.999875, 'segment_size': 16384, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'use_mel_posterior_encoder': False, 'training_files': 'filelists/train.list', 'validation_files': 'filelists/val.list', 'max_wav_value': 32768.0, 'sampling_rate': 44100, 'filter_length': 2048, 'hop_length': 512, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 1, 'cleaned_text': True, 'spk2id': {'tou': 0}}, 'model': {'use_spk_conditioned_encoder': True, 'use_noise_scaled_mas': True, 'use_mel_posterior_encoder': False, 'use_duration_discriminator': True, '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, 8, 2, 2], 'n_layers_q': 3, 'use_spectral_norm': False, 'gin_channels': 256}, 'model_dir': './logs\./OUTPUT_MODEL', 'cont': False}
WARNING:OUTPUT_MODEL:D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package is not a git repository, therefore hash value comparison will be ignored.
INFO:torch.distributed.distributed_c10d:Added key: store_based_barrier_key:1 to store for rank: 0
INFO:torch.distributed.distributed_c10d:Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
skipped: 27 , total: 522
skipped: 0 , total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
256 2
256 2
256 2
256 2
256 2
./logs./OUTPUT_MODEL\DUR_0.pth
error, norm_1.gamma is not in the checkpoint
error, norm_1.beta is not in the checkpoint
error, norm_2.gamma is not in the checkpoint
error, norm_2.beta is not in the checkpoint
error, cond.weight is not in the checkpoint
error, cond.bias is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\DUR_0.pth' (iteration 694)
./logs./OUTPUT_MODEL\G_0.pth
error, emb_g.weight is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\G_0.pth' (iteration 0)
./logs./OUTPUT_MODEL\D_0.pth
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\D_0.pth' (iteration 0)
0it [00:00, ?it/s]
Traceback (most recent call last):
File "train_ms.py", line 402, in
main()
File "train_ms.py", line 60, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 198, in start_processes
while not context.join():
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\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 "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 69, in _wrap
fn(i, *args)
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\train_ms.py", line 217, in train_and_evaluate
for batch_idx, (x, x_lengths, spec, spec_lengths, y, y_lengths, speakers, tone, language, bert) in tqdm(enumerate(train_loader)):
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\tqdm\std.py", line 1178, in iter
for obj in iterable:
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 628, in next
data = self._next_data()
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1333, in _next_data
return self._process_data(data)
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1359, in _process_data
data.reraise()
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch_utils.py", line 543, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data_utils\worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 61, in fetch
return self.collate_fn(data)
File "D:\Bert-VITS2-Integration-Package\Bert-VITS2-Integration-Package\data_utils.py", line 212, in call
spec_padded[i, :, :spec.size(1)] = spec
RuntimeError: expand(torch.FloatTensor{[2, 1025, 316]}, size=[2, 1025]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

前三步好好的,训练就出错了,之前的包是归零的问题

经常训练到训练到一半就报错了RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR

-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "C:\Users\myluck\Desktop\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 69, in wrap
fn(i, *args)
File "C:\Users\myluck\Desktop\AI\Bert-VITS2-Integration-Package\train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "C:\Users\myluck\Desktop\AI\Bert-VITS2-Integration-Package\train_ms.py", line 293, in train_and_evaluate
scaler.scale(loss_gen_all).backward()
File "C:\Users\myluck\Desktop\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch_tensor.py", line 488, in backward
torch.autograd.backward(
File "C:\Users\myluck\Desktop\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\autograd_init
.py", line 197, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
You can try to repro this exception using the following code snippet. If that doesn't trigger the error, please include your original repro script when reporting this issue.
经常训练到一半就报这个错误,大佬能帮我看看是什么问题吗?

开始训练出现问题,代码如下,尝试多次无法解决,求帮忙看下代码如何解决

WARNING:OUTPUT_MODEL:D:\AI\Bert-VITS2-Integration-Package is not a git repository, therefore hash value comparison will be ignored.
INFO:torch.distributed.distributed_c10d:Added key: store_based_barrier_key:1 to store for rank: 0
INFO:torch.distributed.distributed_c10d:Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
skipped: 1 , total: 500
skipped: 0 , total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
256 2
256 2
256 2
256 2
256 2
./logs./OUTPUT_MODEL\DUR_0.pth
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\DUR_0.pth' (iteration 694)
./logs./OUTPUT_MODEL\G_0.pth
error, emb_g.weight is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\G_0.pth' (iteration 0)
./logs./OUTPUT_MODEL\D_0.pth
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\D_0.pth' (iteration 0)
Exception ignored in: <function _MultiProcessingDataLoaderIter.del at 0x000002FBBA6BA790>
Traceback (most recent call last):
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1466, in del
self._shutdown_workers()
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1397, in _shutdown_workers
if not self._shutdown:
AttributeError: '_MultiProcessingDataLoaderIter' object has no attribute '_shutdown'
Traceback (most recent call last):
File "train_first.py", line 409, in
main()
File "train_first.py", line 58, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 198, in start_processes
while not context.join():
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\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 "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 69, in _wrap
fn(i, *args)
File "D:\AI\Bert-VITS2-Integration-Package\train_first.py", line 191, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "D:\AI\Bert-VITS2-Integration-Package\train_first.py", line 215, in train_and_evaluate
for batch_idx, (x, x_lengths, spec, spec_lengths, y, y_lengths, speakers, tone, language, bert) in tqdm(enumerate(train_loader)):
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 430, in iter
self._iterator = self._get_iterator()
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 381, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 988, in init
super(_MultiProcessingDataLoaderIter, self).init(loader)
File "D:\AI\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\utils\data\dataloader.py", line 598, in init
self._sampler_iter = iter(self._index_sampler)
File "D:\AI\Bert-VITS2-Integration-Package\data_utils.py", line 309, in iter
ids_bucket = ids_bucket + ids_bucket * (rem // len_bucket) + ids_bucket[:(rem % len_bucket)]
ZeroDivisionError: integer division or modulo by zero

训练时报错

INFO:OUTPUT_MODEL:{'train': {'log_interval': 10, 'eval_interval': 1000, 'seed': 52, 'epochs': 1000, 'learning_rate': 0.0002, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 16, 'fp16_run': False, 'lr_decay': 0.999875, 'segment_size': 16384, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'use_mel_posterior_encoder': False, 'training_files': 'filelists/train.list', 'validation_files': 'filelists/val.list', 'max_wav_value': 32768.0, 'sampling_rate': 44100, 'filter_length': 2048, 'hop_length': 512, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 1, 'cleaned_text': True, 'spk2id': {'MZ_GIRL': 0}}, 'model': {'use_spk_conditioned_encoder': True, 'use_noise_scaled_mas': True, 'use_mel_posterior_encoder': False, 'use_duration_discriminator': True, '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, 8, 2, 2], 'n_layers_q': 3, 'use_spectral_norm': False, 'gin_channels': 256}, 'model_dir': './logs\./OUTPUT_MODEL', 'cont': False}
WARNING:OUTPUT_MODEL:D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package is not a git repository, therefore hash value comparison will be ignored.
INFO:torch.distributed.distributed_c10d:Added key: store_based_barrier_key:1 to store for rank: 0
INFO:torch.distributed.distributed_c10d:Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
skipped: 0 , total: 757
skipped: 0 , total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
256 2
256 2
256 2
256 2
256 2
./logs./OUTPUT_MODEL\DUR_0.pth
error, norm_1.gamma is not in the checkpoint
error, norm_1.beta is not in the checkpoint
error, norm_2.gamma is not in the checkpoint
error, norm_2.beta is not in the checkpoint
error, cond.weight is not in the checkpoint
error, cond.bias is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\DUR_0.pth' (iteration 694)
./logs./OUTPUT_MODEL\G_0.pth
error, emb_g.weight is not in the checkpoint
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\G_0.pth' (iteration 0)
./logs./OUTPUT_MODEL\D_0.pth
load
INFO:OUTPUT_MODEL:Loaded checkpoint './logs./OUTPUT_MODEL\D_0.pth' (iteration 0)
0it [00:03, ?it/s]
Traceback (most recent call last):
File "train_ms.py", line 402, in
main()
File "train_ms.py", line 60, in main
mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 198, in start_processes
while not context.join():
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\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 "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\multiprocessing\spawn.py", line 69, in wrap
fn(i, *args)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\train_ms.py", line 231, in train_and_evaluate
(z, z_p, m_p, logs_p, m_q, logs_q), (hidden_x, logw, logw
) = net_g(x, x_lengths, spec, spec_lengths, speakers, tone, language, bert)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\nn\parallel\distributed.py", line 1040, in forward
output = self._run_ddp_forward(*inputs, **kwargs)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\nn\parallel\distributed.py", line 1000, in _run_ddp_forward
return module_to_run(*inputs[0], **kwargs[0])
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\models.py", line 680, in forward
z_slice, ids_slice = commons.rand_slice_segments(z, y_lengths, self.segment_size)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\commons.py", line 63, in rand_slice_segments
ret = slice_segments(x, ids_str, segment_size)
File "D:\BaiduNetdiskDownload\0903\Bert-VITS2-Integration-Package\commons.py", line 53, in slice_segments
ret[i] = x[i, :, idx_str:idx_end]
RuntimeError: The expanded size of the tensor (32) must match the existing size (0) at non-singleton dimension 1. Target sizes: [192, 32]. Tensor sizes: [192, 0]

大佬求解,文本预处理的

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine- tuned or trained .Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained .Some weights of EmotionModel were not initialized from the model checkpoint at . 1 emotional/ wav2vec2-large -robust- 12-ft-emotion-msp-dim and are newly initialized: [ ' wav2vec2. encoder . pos conv _ embed . conv . parametrizations .weight. original1' ,'wav2vec2. encoder . pos - conv_ embed . conv . parametrizations . weight . original0']

You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference

Building prefix dict from the default dictionary

Loading model from cache с: Users WuXulAppDataLocalTempljieba . cache ,

Loading model cost 0.280 seconds .

Prefix dict has been built successfully

训练多次时间?

要训练多久啊。我训练出来的模型推理结果都是滋滋噪音, 没有人声

训练的时候 GPU处于空闲状态一直报 gpu 分配内存不足

$python train_ms2.py
加载config中的配置localhost
加载config中的配置10086
加载config中的配置1
加载config中的配置0
加载config中的配置0
加载环境变量
MASTER_ADDR: localhost,
MASTER_PORT: 10086,
WORLD_SIZE: 1,
RANK: 0,
LOCAL_RANK: 0
[W socket.cpp:436] [c10d] The server socket cannot be initialized on [::]:10086 (errno: 97 - Address family not supported by protocol).
[W socket.cpp:663] [c10d] The client socket cannot be initialized to connect to [localhost]:10086 (errno: 97 - Address family not supported by protocol).
12-13 20:42:28 INFO | data_utils.py:63 | Init dataset...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:00<00:00, 80939.87it/s]
12-13 20:42:28 INFO | data_utils.py:78 | skipped: 0, total: 50
12-13 20:42:28 INFO | data_utils.py:63 | Init dataset...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 49932.19it/s]
12-13 20:42:28 INFO | data_utils.py:78 | skipped: 0, total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
INFO:models:Loaded checkpoint 'data/models/DUR_0.pth' (iteration 0)
ERROR:models:enc_p.tone_emb.weight is not in the checkpoint
WARNING:models:Seems you are using the old version of the model, the enc_p.ja_bert_proj.weight is automatically set to zero for backward compatibility
ERROR:models:enc_p.en_bert_proj.weight is not in the checkpoint
ERROR:models:enc_p.en_bert_proj.bias is not in the checkpoint
ERROR:models:enc_p.emo_proj.weight is not in the checkpoint
ERROR:models:enc_p.emo_proj.bias is not in the checkpoint
ERROR:models:enc_p.emo_q_proj.weight is not in the checkpoint
ERROR:models:enc_p.emo_q_proj.bias is not in the checkpoint
ERROR:models:emb_g.weight is not in the checkpoint
INFO:models:Loaded checkpoint 'data/models/G_0.pth' (iteration 0)
INFO:models:Loaded checkpoint 'data/models/D_0.pth' (iteration 0)
检测到模型存在,epoch为 1,gloabl step为 0***
0%| | 0/5 [00:04<?, ?it/s]
Traceback (most recent call last):
File "/home/train_ms2.py", line 722, in
run()
File "/home/TTS/train_ms2.py", line 319, in run
train_and_evaluate(
File "/home//TTS/train_ms2.py", line 468, in train_and_evaluate
y_d_hat_r, y_d_hat_g, _, _ = net_d(y, y_hat.detach())
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1519, in forward
else self._run_ddp_forward(*inputs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1355, in _run_ddp_forward
return self.module(*inputs, **kwargs) # type: ignore[index]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home//miniconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/homeTTS/models.py", line 711, in forward
y_d_r, fmap_r = d(y)
^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/TTS/models.py", line 655, in forward
x = F.leaky_relu(x, modules.LRELU_SLOPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miniconda3/lib/python3.11/site-packages/torch/nn/functional.py", line 1646, in leaky_relu
result = torch._C._nn.leaky_relu(input, negative_slope)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 22.00 MiB. GPU 0 has a total capacty of 15.89 GiB of which 12.12 MiB is free. Including non-PyTorch memory, this process has 15.88 GiB memory in use. Of the allocated memory 14.57 GiB is allocated by PyTorch, and 320.67 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
(myenv)
训练的时候 GPU处于空闲状态一直报 gpu 分配内存不足,请问是什么原因怎么解决呢

训练的时候出现:页面文件太小,无法完成操作的提示

完整报错如下,请问是否有经验的如何解决,已经修改了虚拟内存和减少相关size:
D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1>%PYTHON% train_ms.py -c ./configs/config.json
[W C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\distributed\c10d\socket.cpp:601] [c10d] The client socket has failed to connect to [kubernetes.docker.internal]:65280 (system error: 10049 - 在其上下文中,该请
求的地址无效。).
[W C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\distributed\c10d\socket.cpp:601] [c10d] The client socket has failed to connect to [kubernetes.docker.internal]:65280 (system error: 10049 - 在其上下文中,该请
求的地址无效。).
2023-10-09 17:14:53.542 | INFO | data_utils:_filter:61 - Init dataset...
100%|██████████████████████████████████████████████████████████████████████████████| 51/51 [00:00<00:00, 51162.28it/s]
2023-10-09 17:14:53.544 | INFO | data_utils:_filter:76 - skipped: 0, total: 51
2023-10-09 17:14:53.545 | INFO | data_utils:_filter:61 - Init dataset...
100%|███████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<?, ?it/s]
2023-10-09 17:14:53.545 | INFO | data_utils:_filter:76 - skipped: 0, total: 4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
INFO:OUTPUT_MODEL:Loaded checkpoint './logs\OUTPUT_MODEL\DUR_0.pth' (iteration 0)
ERROR:OUTPUT_MODEL:emb_g.weight is not in the checkpoint
INFO:OUTPUT_MODEL:Loaded checkpoint './logs\OUTPUT_MODEL\G_0.pth' (iteration 0)
INFO:OUTPUT_MODEL:Loaded checkpoint './logs\OUTPUT_MODEL\D_0.pth' (iteration 0)
Traceback (most recent call last):
File "", line 1, in
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\train_ms.py", line 4, in
import torch
File "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\site-packages\torch_init
.py", line 128, in
raise err
OSError: [WinError 1455] 页面文件太小,无法完成操作。 Error loading "D:\BaiduNetdiskDownload\Bert-VITS2-Integration-Package-1.1.1\venv\lib\site-packages\torch\lib\cublas64_11.dll" or one of its dependencies.

训练时跑空,读取DUR_0.pth时报错error, norm_1.gamma is not in the checkpoint

root@36025d9f6349:/workspace/vits2# python train_ms.py -c ./configs/config.json 
INFO:OUTPUT_MODEL:{'train': {'log_interval': 200, 'eval_interval': 1000, 'seed': 52, 'epochs': 10000, 'learning_rate': 0.0003, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 24, 'fp16_run': False, 'lr_decay': 0.999875, 'segment_size': 16384, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0}, 'data': {'use_mel_posterior_encoder': False, 'training_files': 'filelists/train.list', 'validation_files': 'filelists/val.list', 'max_wav_value': 32768.0, 'sampling_rate': 44100, 'filter_length': 2048, 'hop_length': 512, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 1, 'cleaned_text': True, 'spk2id': {'whale': 0}}, 'model': {'use_spk_conditioned_encoder': True, 'use_noise_scaled_mas': True, 'use_mel_posterior_encoder': False, 'use_duration_discriminator': True, '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, 8, 2, 2], 'n_layers_q': 3, 'use_spectral_norm': False, 'gin_channels': 256}, 'model_dir': './logs/./OUTPUT_MODEL', 'cont': False}
INFO:torch.distributed.distributed_c10d:Added key: store_based_barrier_key:1 to store for rank: 0
INFO:torch.distributed.distributed_c10d:Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
skipped:  8 , total:  686
skipped:  0 , total:  4
Using noise scaled MAS for VITS2
Using duration discriminator for VITS2
256 2
256 2
256 2
256 2
256 2
./logs/./OUTPUT_MODEL/DUR_0.pth
error, norm_1.gamma is not in the checkpoint
error, norm_1.beta is not in the checkpoint
error, norm_2.gamma is not in the checkpoint
error, norm_2.beta is not in the checkpoint
error, cond.weight is not in the checkpoint
error, cond.bias is not in the checkpoint
load 
INFO:OUTPUT_MODEL:Loaded checkpoint './logs/./OUTPUT_MODEL/DUR_0.pth' (iteration 694)
./logs/./OUTPUT_MODEL/G_0.pth
error, emb_g.weight is not in the checkpoint
load 
INFO:OUTPUT_MODEL:Loaded checkpoint './logs/./OUTPUT_MODEL/G_0.pth' (iteration 0)
./logs/./OUTPUT_MODEL/D_0.pth
PytorchStreamReader failed reading zip archive: failed finding central directory
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 1
/usr/local/lib/python3.8/dist-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()`. "
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 2
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 3
0it [00:00, ?it/s]
INFO:OUTPUT_MODEL:====> Epoch: 4
0it [00:00, ?it/s]

试了原项目的DUR_0和release中的DUR_0,均存在这个问题
请问有可能是什么导致的?

云端训练报错

Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
    fn(i, *args)
  File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 193, in run
    train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
  File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 217, in train_and_evaluate
    for batch_idx, (x, x_lengths, spec, spec_lengths, y, y_lengths, speakers, tone, language, bert) in tqdm(enumerate(train_loader)):
  File "/root/miniconda3/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
    for obj in iterable:
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
    data = self._next_data()
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
    return self._process_data(data)
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
    data.reraise()
  File "/root/miniconda3/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise
    raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 1.
Original Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
    data = fetcher.fetch(index)
  File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
    return self.collate_fn(data)
  File "/root/Bert-VITS2-Integration-Package/data_utils.py", line 212, in __call__
    spec_padded[i, :, :spec.size(1)] = spec
RuntimeError: expand(torch.FloatTensor{[2, 1025, 413]}, size=[1025, 1025]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

我想问下这是啥问题啊,头疼

数据集重采样和标注·——whisper标注

请问如果我的数据集全部是日语的情况下,
%PYTHON% short_audio_transcribe.py --languages "CJ" --whisper_size large

这里的languages "CJ"是不是改成 languages "J" 就可以?

多语言的版本训练出的模型变成纯电音,是必须有多语言的语料吗? 还是其他原因导致的?

之前用中日版本(1.1)的脚本处理的素材,训练时发现在第一个Epoch后,就能听到有点对的口音了,但是到100步后电音就很厉害,1000步后就变成电流纯噪声了。

但是相同的素材(包括train.list, val.list)都完全相同,把代码和底模切换到1.0纯中文的最新版本,训练到1000步的效果是很好的。

然后今天试了下中英日2.1版本,素材还是一样,重新执行了bert_gen.py,新增执行了emo_gen.py,训练时和1.1一样很快就变成电音了。

请问是必须有多语言的素材,还是配置文件或者其他方面有错误呢?

训练出来的声音机械感很强

请问训练需要调参么,我用了大概2h的数据,训练了4小时左右,音色很像, 也没有杂声,但是有很强的机械感,声音很僵硬是为什么啊

RuntimeError: expand(torch.FloatTensor{[2, 1025, 278]}, size=[2, 1025]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3),这是什么错误啊?

训练报错,错误是:
RuntimeError: expand(torch.FloatTensor{[2, 1025, 278]}, size=[2, 1025]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

详细的错误信息为:

ProcessRaisedException Traceback (most recent call last)
File ~/autodl-tmp/Bert-VITS2-Integration-Package/train_ms.py:402, in
399 generator.train()
401 if name == "main":
--> 402 main()

File ~/autodl-tmp/Bert-VITS2-Integration-Package/train_ms.py:60, in main()
58 shutil.copy('./pretrained_models/G_0.pth','./logs/OUTPUT_MODEL/G_0.pth')
59 shutil.copy('./pretrained_models/DUR_0.pth','./logs/OUTPUT_MODEL/DUR_0.pth')
---> 60 mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,))

File ~/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py:239, in spawn(fn, args, nprocs, join, daemon, start_method)
235 msg = ('This method only supports start_method=spawn (got: %s).\n'
236 'To use a different start_method use:\n\t\t'
237 ' torch.multiprocessing.start_processes(...)' % start_method)
238 warnings.warn(msg)
--> 239 return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')

File ~/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py:197, in start_processes(fn, args, nprocs, join, daemon, start_method)
194 return context
196 # Loop on join until it returns True or raises an exception.
--> 197 while not context.join():
198 pass

File ~/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py:160, in ProcessContext.join(self, timeout)
158 msg = "\n\n-- Process %d terminated with the following error:\n" % error_index
159 msg += original_trace
--> 160 raise ProcessRaisedException(msg, error_index, failed_process.pid)

ProcessRaisedException:

-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/root/autodl-tmp/Bert-VITS2-Integration-Package/train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "/root/autodl-tmp/Bert-VITS2-Integration-Package/train_ms.py", line 217, in train_and_evaluate
for batch_idx, (x, x_lengths, spec, spec_lengths, y, y_lengths, speakers, tone, language, bert) in tqdm(enumerate(train_loader)):
File "/root/miniconda3/lib/python3.8/site-packages/tqdm/std.py", line 1182, in iter
for obj in iterable:
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in next
data = self._next_data()
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/root/miniconda3/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
return self.collate_fn(data)
File "/root/autodl-tmp/Bert-VITS2-Integration-Package/data_utils.py", line 212, in call
spec_padded[i, :, :spec.size(1)] = spec
RuntimeError: expand(torch.FloatTensor{[2, 1025, 278]}, size=[2, 1025]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

有人遇到这个错误吗 assert (discriminant >= 0).all()

File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 193, in run
train_and_evaluate(rank, epoch, hps, [net_g, net_d, net_dur_disc], [optim_g, optim_d, optim_dur_disc], [scheduler_g, scheduler_d, scheduler_dur_disc], scaler, [train_loader, eval_loader], logger, [writer, writer_eval])
File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 329, in train_and_evaluate
evaluate(hps, net_g, eval_loader, writer_eval)
File "/root/Bert-VITS2-Integration-Package/train_ms.py", line 363, in evaluate
y_hat, attn, mask, *_ = generator.module.infer(x, x_lengths, speakers, tone, language, bert, y=spec, max_len=1000, sdp_ratio=0.0 if not use_sdp else 1.0)
File "/root/Bert-VITS2-Integration-Package/models.py", line 692, in infer
logw = self.sdp(x, x_mask, g=g, reverse=True, noise_scale=noise_scale_w) * (sdp_ratio) + self.dp(x, x_mask, g=g) * (1 - sdp_ratio)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/Bert-VITS2-Integration-Package/models.py", line 199, in forward
z = flow(z, x_mask, g=x, reverse=reverse)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/root/Bert-VITS2-Integration-Package/modules.py", line 374, in forward
x1, logabsdet = piecewise_rational_quadratic_transform(x1,
File "/root/Bert-VITS2-Integration-Package/transforms.py", line 33, in piecewise_rational_quadratic_transform
outputs, logabsdet = spline_fn(
File "/root/Bert-VITS2-Integration-Package/transforms.py", line 82, in unconstrained_rational_quadratic_spline
outputs[inside_interval_mask], logabsdet[inside_interval_mask] = rational_quadratic_spline(
File "/root/Bert-VITS2-Integration-Package/transforms.py", line 164, in rational_quadratic_spline
assert (discriminant >= 0).all()
AssertionError

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.