项目地址:https://github.com/r9y9/deepvoice3_pytorch
解决两个问题:一使用外部数据集训练,二加载pre-trained模型做fine-tune
1:安装必要依赖库
- 其中pytorch如下
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-win_amd64.whl
pip3 install torchvision
- 安装完成后,需下载win-64/intel-openmp-2018.0.0-8.tar.bz2 ,把bin文件夹加到PATH环境变量
2:生成两个json文件
- alignment.json (wav - text对)
- my_presets_dv.json (模型配置文件,可用相应模型的json修改,比如/presets/deepvoice3_ljspeech.json)
注意修改wav文件的采样率、训练集合适的batch_size
3:preprocess
- 如果新数据集路径./datasets/audio
$ python preprocess.py json_meta "./datasets/alignment.json" "./datasets/audio" --preset=./datasets/my_presets_dv.json
- 完成后如下图
4:下载pre-trained模型文件
- 放到路径./model/20180505_deepvoice3_checkpoint_step000640000.pth
- 下载对应commit的preset文件(json)
5:train
- 命令 python train.py <option>
- python train.py --data-root=./datasets/audio --checkpoint-dir=checkpoints_adaptation --checkpoint=./model/20180505_deepvoice3_checkpoint_step000640000.pth --preset=./datasets/my_presets_dv.json --log-event-path=log/deepvoice3_spk_adaptation --speaker-id=0