GPT-SoVITS
GPT-SoVITS copied to clipboard
【蠢问题】项目名称不能使用中文
trafficstars
若项目名称出现中文,会导致微调过程中报错
将项目名称改为英文后重新一键三联,然后进行微调,错误消失。
错误信息如下:
"D:\GPT-SoVITS-beta\runtime\python.exe" GPT_SoVITS/s1_train.py --config_file "D:\GPT-SoVITS-beta\TEMP/tmp_s1.yaml"
Seed set to 1234
Using 16bit Automatic Mixed Precision (AMP)
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
<All keys matched successfully>
ckpt_path: None
[rank: 0] Seed set to 1234
Initializing distributed: GLOBAL_RANK: 0, MEMBER: 1/1
[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 [Lenovo-R9000P]:56614 (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 [Lenovo-R9000P]:56614 (system error: 10049 - 在其上下文中,该请求的地址无效。).----------------------------------------------------------------------------------------------------
distributed_backend=gloo
All distributed processes registered. Starting with 1 processes
----------------------------------------------------------------------------------------------------
Missing logger folder: logs\项目名称—中文\logs_s1\logs_s1
semantic_data_len: 0
phoneme_data_len: 0
Empty DataFrame
Columns: [item_name, semantic_audio]
Index: []
Traceback (most recent call last):
File "D:\GPT-SoVITS-beta\GPT_SoVITS\s1_train.py", line 170, in <module>
main(args)
File "D:\GPT-SoVITS-beta\GPT_SoVITS\s1_train.py", line 146, in main
trainer.fit(model, data_module, ckpt_path=ckpt_path)
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 544, in fit
call._call_and_handle_interrupt(
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\trainer\call.py", line 43, in _call_and_handle_interrupt
return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\strategies\launchers\subprocess_script.py", line 102, in launch
return function(*args, **kwargs)
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 580, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 950, in _run
call._call_setup_hook(self) # allow user to setup lightning_module in accelerator environment
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\trainer\call.py", line 92, in _call_setup_hook
_call_lightning_datamodule_hook(trainer, "setup", stage=fn)
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\pytorch_lightning\trainer\call.py", line 179, in _call_lightning_datamodule_hook
return fn(*args, **kwargs)
File "D:\GPT-SoVITS-beta\GPT_SoVITS\AR\data\data_module.py", line 29, in setup
self._train_dataset = Text2SemanticDataset(
File "D:\GPT-SoVITS-beta\GPT_SoVITS\AR\data\dataset.py", line 107, in __init__
self.init_batch()
File "D:\GPT-SoVITS-beta\GPT_SoVITS\AR\data\dataset.py", line 187, in init_batch
for _ in range(max(2, int(min_num / leng))):
ZeroDivisionError: division by zero
"D:\GPT-SoVITS-beta\runtime\python.exe" GPT_SoVITS/s2_train.py --config "D:\GPT-SoVITS-beta\TEMP/tmp_s2.json"
INFO:项目名称—中文:{'train': {'log_interval': 100, 'eval_interval': 500, 'seed': 1234, 'epochs': 8, 'learning_rate': 0.0001, 'betas': [0.8, 0.99], 'eps': 1e-09, 'batch_size': 4, 'fp16_run': True, 'lr_decay': 0.999875, 'segment_size': 20480, 'init_lr_ratio': 1, 'warmup_epochs': 0, 'c_mel': 45, 'c_kl': 1.0, 'text_low_lr_rate': 0.4, 'pretrained_s2G': 'GPT_SoVITS/pretrained_models/s2G488k.pth', 'pretrained_s2D': 'GPT_SoVITS/pretrained_models/s2D488k.pth', 'if_save_latest': True, 'if_save_every_weights': True, 'save_every_epoch': 4, 'gpu_numbers': '0'}, 'data': {'max_wav_value': 32768.0, 'sampling_rate': 32000, 'filter_length': 2048, 'hop_length': 640, 'win_length': 2048, 'n_mel_channels': 128, 'mel_fmin': 0.0, 'mel_fmax': None, 'add_blank': True, 'n_speakers': 300, 'cleaned_text': True, 'exp_dir': 'logs/项目名称—中文'}, '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': [10, 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': 512, 'semantic_frame_rate': '25hz', 'freeze_quantizer': True}, 's2_ckpt_dir': 'logs/项目名称—中文', 'content_module': 'cnhubert', 'save_weight_dir': 'SoVITS_weights', 'name': '项目名称—中文', 'pretrain': None, 'resume_step': None}
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.
Traceback (most recent call last):
File "D:\GPT-SoVITS-beta\GPT_SoVITS\s2_train.py", line 600, in <module>
main()
File "D:\GPT-SoVITS-beta\GPT_SoVITS\s2_train.py", line 56, in main
mp.spawn(
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\torch\multiprocessing\spawn.py", line 239, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "D:\GPT-SoVITS-beta\runtime\lib\site-packages\torch\multiprocessing\spawn.py", line 197, in start_processes
while not context.join():
File "D:\GPT-SoVITS-beta\runtime\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:\GPT-SoVITS-beta\runtime\lib\site-packages\torch\multiprocessing\spawn.py", line 69, in _wrap
fn(i, *args)
File "D:\GPT-SoVITS-beta\GPT_SoVITS\s2_train.py", line 85, in run
train_dataset = TextAudioSpeakerLoader(hps.data) ########
File "D:\GPT-SoVITS-beta\GPT_SoVITS\module\data_utils.py", line 56, in __init__
for _ in range(max(2, int(min_num / leng))):
ZeroDivisionError: division by zero
我尝试使用了三个项目名称:1. 项目名称中文;2. 项目名称-中文;3. 项目名称—中文;main 分支代码均训练成功,未能复现出 division by zero 的错误。即便如此还是建议采用英文路径减少出错的可能。 通常该错误出现的原因是数据集准备结果不当,可以尝试更换数据集,更新到最新代码等,如果仍有问题还请反馈。
已知中文名作为项目名会出错,我后面兼容一下。
现在均已支持中文路径