from modelscope.metainfo import Trainers
from modelscope.trainers import build_trainer
from modelscope.utils.audio.audio_utils import TtsTrainType
pretrained_model_id = '/home/gpu/.cache/modelscope/hub/damo/speech_sambert-hifigan_tts_zhiyan_emo_zh-cn_16k/'
dataset_id = './output_dir/'
pretrain_work_dir = './pretrain_work_dir/'
train_info = {
TtsTrainType.TRAIN_TYPE_SAMBERT: {
'train_steps': 240020,
'save_interval_steps': 60000,
'log_interval': 2000
},
}
kwargs = dict(
model=pretrained_model_id,
model_revision = "v1.0.6",
work_dir=pretrain_work_dir,
train_dataset=dataset_id,
train_type=train_info 数
)
trainer = build_trainer(Trainers.speech_kantts_trainer,
default_args=kwargs)
trainer.train()
===================>
2023-10-31 10:16:36,782 - modelscope - INFO - se_path=./pretrain_work_dir/orig_model/voices/zhiyan_emo/am/se.npy se_model_path=./pretrain_work_dir/orig_model/voices/zhiyan_emo/se/ckpt/se.onnx
2023-10-31 10:16:36,782 - modelscope - INFO - mvn_path=./pretrain_work_dir/orig_model/voices/zhiyan_emo/am/mvn.npy
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
Load pinyin_en_mix_dict failed
text.cc: festival_Text_init
==============Config:============
/home/gpu/KAN/KAN-TTS
Traceback (most recent call last):
File "/home/gpu/KAN/KAN-TTS/train2.py", line 53, in
trainer.train()
File "/opt/miniconda3/envs/maas/lib/python3.10/site-packages/modelscope/trainers/audio/tts_trainer.py", line 231, in train
self.prepare_data()
File "/opt/miniconda3/envs/maas/lib/python3.10/site-packages/modelscope/trainers/audio/tts_trainer.py", line 207, in prepare_data
self.audio_data_preprocessor(self.raw_dataset_path, self.data_dir,
File "/opt/miniconda3/envs/maas/lib/python3.10/site-packages/modelscope/preprocessors/tts.py", line 36, in call
self.do_data_process(data_dir, output_dir, audio_config_path,
File "/opt/miniconda3/envs/maas/lib/python3.10/site-packages/modelscope/preprocessors/tts.py", line 54, in do_data_process
raise TtsDataPreprocessorAudioConfigNotExistsException(
modelscope.utils.audio.tts_exceptions.TtsDataPreprocessorAudioConfigNotExistsException: Preprocessor: audio config not exists
===================================
使用 pretrained_model_id = '/home/gpu/.cache/modelscope/hub/damo/speech_personal_sambert-hifigan_nsf_tts_zh-cn_pretrain_16k' 时,可以正常训练。
同样代码
不知道错在那里
从您提供的错误日志来看,您在运行模型训练时遇到了一些问题。这些问题似乎是加载拼音-英文混合字典时出现的。这可能是因为字典文件的路径不正确,或者字典文件本身存在问题。
以下是一些可能的解决方案:
检查字典文件的路径:确保您的代码中的字典文件路径是正确的。如果您使用的是相对路径,请确保它们相对于您的脚本的位置。
检查字典文件:尝试打开字典文件并查看其中的内容。如果文件为空或包含错误的数据,那么这可能是问题所在。
重新下载字典文件:如果您无法解决问题,可以尝试从官方源重新下载字典文件。
更新模型库:确保您使用的模型库是最新的。有时,旧版本的库可能会导致这样的问题。