fix argparse argument names, update shell scripts

This commit is contained in:
iclementine 2021-08-20 20:46:20 +08:00
parent ad74b7a120
commit 2e9ffcb6d0
6 changed files with 10 additions and 10 deletions

View File

@ -44,11 +44,11 @@ from pwg_updater import PWGUpdater, PWGEvaluator
def train_sp(args, config):
# decides device type and whether to run in parallel
# setup running environment correctly
if not paddle.is_compiled_with_cuda:
world_size = paddle.distributed.get_world_size()
if not paddle.is_compiled_with_cuda():
paddle.set_device("cpu")
else:
paddle.set_device("gpu")
world_size = paddle.distributed.get_world_size()
if world_size > 1:
paddle.distributed.init_parallel_env()

View File

@ -101,7 +101,7 @@ When training is done or pretrained models are downloaded. You can run `synthesi
usage: synthesize_e2e.py [-h] [--speedyspeech-config SPEEDYSPEECH_CONFIG]
[--speedyspeech-checkpoint SPEEDYSPEECH_CHECKPOINT]
[--speedyspeech-stat SPEEDYSPEECH_STAT]
[--pwg-config PWG_CONFIG] [--pwg-params PWG_PARAMS]
[--pwg-config PWG_CONFIG] [--pwg-params PWG_CHECKPOINT]
[--pwg-stat PWG_STAT] [--text TEXT]
[--output-dir OUTPUT_DIR]
[--inference-dir INFERENCE_DIR] [--device DEVICE]
@ -120,7 +120,7 @@ optional arguments:
spectrogram when training speedyspeech.
--pwg-config PWG_CONFIG
config file for parallelwavegan.
--pwg-checkpoint PWG_PARAMS
--pwg-checkpoint PWG_CHECKPOINT
parallel wavegan checkpoint to load.
--pwg-stat PWG_STAT mean and standard deviation used to normalize
spectrogram when training speedyspeech.

View File

@ -49,7 +49,7 @@ def evaluate(args, speedyspeech_config, pwg_config):
model.eval()
vocoder = PWGGenerator(**pwg_config["generator_params"])
vocoder.set_state_dict(paddle.load(args.pwg_params))
vocoder.set_state_dict(paddle.load(args.pwg_checkpoint)["generator_params"])
vocoder.remove_weight_norm()
vocoder.eval()
print("model done!")
@ -126,7 +126,7 @@ def main():
parser.add_argument(
"--pwg-config", type=str, help="config file for parallelwavegan.")
parser.add_argument(
"--pwg-params",
"--pwg-checkpoint",
type=str,
help="parallel wavegan generator parameters to load.")
parser.add_argument(

View File

@ -3,7 +3,7 @@ python synthesize.py \
--speedyspeech-checkpoint=exp/default/checkpoints/snapshot_iter_91800.pdz \
--speedyspeech-stat=dump/train/stats.npy \
--pwg-config=../../parallelwave_gan/baker/conf/default.yaml \
--pwg-params=../../parallelwave_gan/baker/converted.pdparams \
--pwg-checkpoint=../../parallelwave_gan/baker/exp/default/checkpoints/snapshot_iter_400000.pdz \
--pwg-stat=../../parallelwave_gan/baker/dump/train/stats.npy \
--test-metadata=dump/test/norm/metadata.jsonl \
--output-dir=exp/debug/test \

View File

@ -3,7 +3,7 @@ python synthesize_e2e.py \
--speedyspeech-checkpoint=exp/debug/checkpoints/snapshot_iter_91800.pdz \
--speedyspeech-stat=dump/train/stats.npy \
--pwg-config=../../parallelwave_gan/baker/conf/default.yaml \
--pwg-params=../../parallelwave_gan/baker/converted.pdparams \
--pwg-checkpoint=../../parallelwave_gan/baker/exp/default/checkpoints/snapshot_iter_400000.pdz \
--pwg-stat=../../parallelwave_gan/baker/dump/train/stats.npy \
--text=sentences.txt \
--output-dir=exp/debug/e2e \

View File

@ -42,11 +42,11 @@ from speedyspeech_updater import SpeedySpeechUpdater, SpeedySpeechEvaluator
def train_sp(args, config):
# decides device type and whether to run in parallel
# setup running environment correctly
if not paddle.is_compiled_with_cuda:
world_size = paddle.distributed.get_world_size()
if not paddle.is_compiled_with_cuda():
paddle.set_device("cpu")
else:
paddle.set_device("gpu")
world_size = paddle.distributed.get_world_size()
if world_size > 1:
paddle.distributed.init_parallel_env()