Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据集过大时训练报错: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] #2

Open
Fantendo2001 opened this issue Feb 28, 2023 · 5 comments

Comments

@Fantendo2001
Copy link

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]

当数据集(音频数量)较大时(如500),训练时会出现该报错。当数据集较小时(如200),可以正常训练。

config以lex_base为基础改的,语音数据和标注是自己的。

{
"train": {
"log_interval": 200,
"eval_interval": 1000,
"seed": 1234,
"epochs": 2000,
"learning_rate": 2e-4,
"betas": [0.8, 0.99],
"eps": 1e-9,
"batch_size": 16,
"fp16_run": true,
"lr_decay": 0.999875,
"segment_size": 8192,
"init_lr_ratio": 1,
"warmup_epochs": 0,
"c_mel": 45,
"c_kl": 1.0
},
"data": {
"training_files":"filelists/66_audio_text_train_filelist.txt.cleaned",
"validation_files":"filelists/66_audio_text_train_filelist.txt.cleaned",
"language": "cmn",
"text_cleaners":["chinese_cleaners"],
"max_wav_value": 32768.0,
"sampling_rate": 22050,
"filter_length": 1024,
"hop_length": 256,
"win_length": 1024,
"n_mel_channels": 80,
"mel_fmin": 0.0,
"mel_fmax": null,
"add_blank": true,
"n_speakers": 0,
"cleaned_text": true
},
"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],
"upsample_initial_channel": 512,
"upsample_kernel_sizes": [16,16,4,4],
"n_layers_q": 3,
"use_spectral_norm": false
},
"data_loader": {
"use_train_sampler": true,
"num_workers": 2
},
"checkpoints": {
"g_pretrained_path": "pretrained_weights/G_bb_v100_820000.pth",
"d_pretrained_path": "pretrained_weights/D_bb_v100_820000.pth",
"auto_delete_old_checkpoints": true,
"replace_old_checkpoints_mode": false,
"num_checkpoints_to_keep": 2
}
}

@eve2ptp
Copy link

eve2ptp commented Feb 28, 2023

batch_size根据自己显存调整

@Fantendo2001
Copy link
Author

batch_size根据自己显存调整

谢谢回答!但用colab40GB的A100之后batch size降到了2了还是会出问题:(,有可能是其他方面的问题吗?

@Fantendo2001
Copy link
Author

降低batch size无果,最后通过减少train和val的数据量解决了

@zhazl
Copy link

zhazl commented Apr 12, 2023

同样遇到这个问题

@liziru
Copy link

liziru commented Dec 9, 2023

降低batch size无果,最后通过减少train和val的数据量解决了

请问还有更好的解决办法吗,数据集也比较大。@ @Fantendo2001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants