parse.py 3.1 KB
Newer Older
L
lifuchen 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
L
lifuchen 已提交
14 15
import argparse

L
lifuchen 已提交
16

L
lifuchen 已提交
17
def add_config_options_to_parser(parser):
L
lifuchen 已提交
18 19 20
    parser.add_argument(
        '--config_path',
        type=str,
21
        default='configs/train_transformer.yaml',
L
lifuchen 已提交
22
        help="the yaml config file path.")
L
lifuchen 已提交
23 24 25 26 27 28
    parser.add_argument(
        '--batch_size', type=int, default=32, help="batch size for training.")
    parser.add_argument(
        '--epochs',
        type=int,
        default=10000,
L
lifuchen 已提交
29
        help="the number of epoch for training.")
L
lifuchen 已提交
30 31 32 33
    parser.add_argument(
        '--lr',
        type=float,
        default=0.001,
L
lifuchen 已提交
34
        help="the learning rate for training.")
L
lifuchen 已提交
35 36 37 38
    parser.add_argument(
        '--save_step',
        type=int,
        default=500,
L
lifuchen 已提交
39
        help="checkpointing interval during training.")
L
lifuchen 已提交
40 41 42 43
    parser.add_argument(
        '--image_step',
        type=int,
        default=2000,
L
lifuchen 已提交
44
        help="attention image interval during training.")
L
lifuchen 已提交
45 46 47 48
    parser.add_argument(
        '--max_len',
        type=int,
        default=400,
L
lifuchen 已提交
49
        help="The max length of audio when synthsis.")
L
lifuchen 已提交
50 51 52 53
    parser.add_argument(
        '--transformer_step',
        type=int,
        default=160000,
L
lifuchen 已提交
54
        help="Global step to restore checkpoint of transformer.")
L
lifuchen 已提交
55 56 57 58
    parser.add_argument(
        '--vocoder_step',
        type=int,
        default=90000,
L
lifuchen 已提交
59
        help="Global step to restore checkpoint of postnet.")
L
lifuchen 已提交
60 61 62 63
    parser.add_argument(
        '--use_gpu',
        type=int,
        default=1,
L
lifuchen 已提交
64
        help="use gpu or not during training.")
L
lifuchen 已提交
65 66 67 68
    parser.add_argument(
        '--use_data_parallel',
        type=int,
        default=0,
L
lifuchen 已提交
69
        help="use data parallel or not during training.")
L
lifuchen 已提交
70 71 72 73
    parser.add_argument(
        '--stop_token',
        type=int,
        default=0,
L
lifuchen 已提交
74 75
        help="use stop token loss in network or not.")

L
lifuchen 已提交
76 77 78 79
    parser.add_argument(
        '--data_path',
        type=str,
        default='./dataset/LJSpeech-1.1',
L
lifuchen 已提交
80
        help="the path of dataset.")
L
lifuchen 已提交
81 82 83 84
    parser.add_argument(
        '--checkpoint_path',
        type=str,
        default=None,
L
lifuchen 已提交
85
        help="the path to load checkpoint or pretrain model.")
L
lifuchen 已提交
86 87 88 89
    parser.add_argument(
        '--save_path',
        type=str,
        default='./checkpoint',
L
lifuchen 已提交
90
        help="the path to save checkpoint.")
L
lifuchen 已提交
91 92 93 94
    parser.add_argument(
        '--log_dir',
        type=str,
        default='./log',
L
lifuchen 已提交
95
        help="the directory to save tensorboard log.")
L
lifuchen 已提交
96 97 98 99
    parser.add_argument(
        '--sample_path',
        type=str,
        default='./sample',
L
lifuchen 已提交
100
        help="the directory to save audio sample in synthesis.")