Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel WaveGAN with CSMSC error #1505

Closed
yJun-Chen opened this issue Feb 28, 2022 · 17 comments
Closed

Parallel WaveGAN with CSMSC error #1505

yJun-Chen opened this issue Feb 28, 2022 · 17 comments

Comments

@yJun-Chen
Copy link

yJun-Chen commented Feb 28, 2022

我参考这个案例进行训练
https://github.com/PaddlePaddle/PaddleSpeech/tree/19f67e1f564f1dcd49b89159b39bb4a34b7b6cdd/examples/csmsc/voc1

已经下载好了数据集

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ll ~/datasets/
total 1156
drwxr-sr-x 3 root   users 593920 Feb 25 09:31 ./
drwsrwsr-x 1 jovyan users   4096 Feb 28 06:06 ../
drwxr-sr-x 3 root   users 577536 Feb 25 09:31 BZNSYP/

baker_alignment_tone.tar.gz文件也解压到了当前的目录中
已经满足了README文件中的条件

Assume the path to the dataset is ~/datasets/BZNSYP. Assume the path to the MFA result of CSMSC is ./baker_alignment_tone. Run the command below to

source path.
preprocess the dataset.
train the model.
synthesize wavs.
synthesize waveform from metadata.jsonl.
./run.sh

在运行run.sh 的时候,我得到了下面的错误信息,我不知道该怎样解决

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ./run.sh
Generate durations.txt from MFA results ...
Extract features ...
/home/jovyan/datasets/BZNSYP
Get features' stats ...
Traceback (most recent call last):
  File "/opt/PaddleSpeech/utils/compute_statistics.py", line 109, in <module>
    main()
  File "/opt/PaddleSpeech/utils/compute_statistics.py", line 84, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/raw/metadata.jsonl'
Normalize ...
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/raw/metadata.jsonl'
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/dev/raw/metadata.jsonl'
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/test/raw/metadata.jsonl'

dump/train/raw/metadata.jsonl 应该是run.sh 生成的吧,但实际上并没有生成这个文件

@yt605155624
Copy link
Collaborator

if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
应该是这一步没有正确执行,请检查自己的目录下是否有 dump 文件夹,上一步执行好的话,应该会有个 durations.txt 文件,可以把preprocess.sh 的 stage 和 stop-stage 都改成 1 只执行 stage 1 试试

@yJun-Chen
Copy link
Author

是有生成dump 文件夹和durations.txt文件

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# tree dump/
dump/
|-- dev
|   |-- norm
|   `-- raw
|-- test
|   |-- norm
|   `-- raw
`-- train
    |-- norm
    `-- raw

9 directories, 0 files
(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ll
total 6932
drwxr-xr-x  6 root root    4096 Feb 28 06:27 ./
drwxr-xr-x 10 root root    4096 Feb 25 08:27 ../
-rw-r--r--  1 root root    6842 Feb 25 08:27 README.md
drwxr-xr-x  3 1010 1012    4096 Jul  2  2021 baker_alignment_tone/
-rw-r--r--  1 root root 4954921 Aug  4  2021 baker_alignment_tone.tar.gz
drwxr-xr-x  2 root root    4096 Feb 25 08:27 conf/
drwxr-xr-x  5 root root    4096 Feb 28 06:08 dump/
-rw-r--r--  1 root root 2097388 Feb 28 06:14 durations.txt
drwxr-xr-x  2 root root    4096 Feb 28 06:28 local/
-rwxr-xr-x  1 root root     393 Feb 25 08:27 path.sh*
-rwxr-xr-x  1 root root     929 Feb 25 08:27 run.sh*

我把preprocess.sh 的 stage 和 stop-stage 都改成 1,执行后依旧会报错

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ./run.sh 
Extract features ...
/home/jovyan/datasets/BZNSYP
========Args========
batch_size: 8
config: conf/default.yaml
dev_metadata: dump/dev/norm/metadata.jsonl
max_iter: 400000
ngpu: 1
output_dir: exp/default
profiler_options: null
run_benchmark: false
train_metadata: dump/train/norm/metadata.jsonl

========Config========
batch_max_steps: 25500
batch_size: 8
discriminator_grad_norm: 1
discriminator_optimizer_params:
  epsilon: 1e-06
  weight_decay: 0.0
discriminator_params:
  bias: True
  conv_channels: 64
  in_channels: 1
  kernel_size: 3
  layers: 10
  nonlinear_activation: leakyrelu
  nonlinear_activation_params:
    negative_slope: 0.2
  out_channels: 1
  use_weight_norm: True
discriminator_scheduler_params:
  gamma: 0.5
  learning_rate: 5e-05
  step_size: 200000
discriminator_train_start_steps: 100000
eval_interval_steps: 1000
fmax: 7600
fmin: 80
fs: 24000
generator_grad_norm: 10
generator_optimizer_params:
  epsilon: 1e-06
  weight_decay: 0.0
generator_params:
  aux_channels: 80
  aux_context_window: 2
  bias: True
  dropout: 0.0
  freq_axis_kernel_size: 1
  gate_channels: 128
  in_channels: 1
  interpolate_mode: nearest
  kernel_size: 3
  layers: 30
  nonlinear_activation: None
  nonlinear_activation_params:
    
  out_channels: 1
  residual_channels: 64
  skip_channels: 64
  stacks: 3
  upsample_scales: [4, 5, 3, 5]
  use_causal_conv: False
  use_weight_norm: True
generator_scheduler_params:
  gamma: 0.5
  learning_rate: 0.0001
  step_size: 200000
lambda_adv: 4.0
n_fft: 2048
n_mels: 80
n_shift: 300
num_save_intermediate_results: 4
num_snapshots: 10
num_workers: 2
save_interval_steps: 5000
seed: 42
stft_loss_params:
  fft_sizes: [1024, 2048, 512]
  hop_sizes: [120, 240, 50]
  win_lengths: [600, 1200, 240]
  window: hann
train_max_steps: 400000
win_length: 1200
window: hann
master see the word size: 1, from pid: 4130
rank: 0, pid: 4130, parent_pid: 4129
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 264, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 260, in main
    train_sp(args, config)
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 69, in train_sp
    with jsonlines.open(args.train_metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/norm/metadata.jsonl'

image

@yt605155624
Copy link
Collaborator

请检查对应文件是否存在,不存在修改 stage 和 stop_stage 继续生成即可

@yJun-Chen
Copy link
Author

对应文件指的是什么文件,现在好像就是dump/train/norm/metadata.jsonl 文件不存在
是要继续运行 stage 0和 stop_stage 0 这样么?

@yt605155624
Copy link
Collaborator

stage=2 stop_stage=2 运行一遍
stage=3 stop_stage=3 再运行一遍

@yJun-Chen
Copy link
Author

./run.sh --stage 0 --stop-stage 0

这个没有报错

./run.sh --stage 1--stop-stage 1
./run.sh --stage 2--stop-stage 2

1 的错误和刚才是一样的,这是2的错误

Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../synthesize.py", line 121, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../synthesize.py", line 82, in main
    state_dict = paddle.load(args.checkpoint)
  File "/opt/conda/lib/python3.8/site-packages/paddle/framework/io.py", line 985, in load
    load_result = _legacy_load(path, **configs)
  File "/opt/conda/lib/python3.8/site-packages/paddle/framework/io.py", line 1003, in _legacy_load
    model_path, config = _build_load_path_and_config(path, config)
  File "/opt/conda/lib/python3.8/site-packages/paddle/framework/io.py", line 161, in _build_load_path_and_config
    raise ValueError(error_msg % path)
ValueError: The ``path`` (exp/default/checkpoints/snapshot_iter_5000.pdz) to load model not exists.

3的话没有输出信息,也没有报错信息

@yt605155624
Copy link
Collaborator

stage=2 stop_stage=2 运行一遍 stage=3 stop_stage=3 再运行一遍

让你改的是 prepprcess.sh 里面的这两个变量啊

@yJun-Chen
Copy link
Author

更改prepprcess.sh 的stage=2 stop_stage=2

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ./run.sh 
Get features' stats ...
Traceback (most recent call last):
  File "/opt/PaddleSpeech/utils/compute_statistics.py", line 109, in <module>
    main()
  File "/opt/PaddleSpeech/utils/compute_statistics.py", line 84, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/raw/metadata.jsonl'
========Args========
batch_size: 8
config: conf/default.yaml
dev_metadata: dump/dev/norm/metadata.jsonl
max_iter: 400000
ngpu: 0
output_dir: exp/default
profiler_options: null
run_benchmark: false
train_metadata: dump/train/norm/metadata.jsonl

========Config========
batch_max_steps: 25500
batch_size: 8
discriminator_grad_norm: 1
discriminator_optimizer_params:
  epsilon: 1e-06
  weight_decay: 0.0
discriminator_params:
  bias: True
  conv_channels: 64
  in_channels: 1
  kernel_size: 3
  layers: 10
  nonlinear_activation: leakyrelu
  nonlinear_activation_params:
    negative_slope: 0.2
  out_channels: 1
  use_weight_norm: True
discriminator_scheduler_params:
  gamma: 0.5
  learning_rate: 5e-05
  step_size: 200000
discriminator_train_start_steps: 100000
eval_interval_steps: 1000
fmax: 7600
fmin: 80
fs: 24000
generator_grad_norm: 10
generator_optimizer_params:
  epsilon: 1e-06
  weight_decay: 0.0
generator_params:
  aux_channels: 80
  aux_context_window: 2
  bias: True
  dropout: 0.0
  freq_axis_kernel_size: 1
  gate_channels: 128
  in_channels: 1
  interpolate_mode: nearest
  kernel_size: 3
  layers: 30
  nonlinear_activation: None
  nonlinear_activation_params:
    
  out_channels: 1
  residual_channels: 64
  skip_channels: 64
  stacks: 3
  upsample_scales: [4, 5, 3, 5]
  use_causal_conv: False
  use_weight_norm: True
generator_scheduler_params:
  gamma: 0.5
  learning_rate: 0.0001
  step_size: 200000
lambda_adv: 4.0
n_fft: 2048
n_mels: 80
n_shift: 300
num_save_intermediate_results: 4
num_snapshots: 10
num_workers: 2
save_interval_steps: 5000
seed: 42
stft_loss_params:
  fft_sizes: [1024, 2048, 512]
  hop_sizes: [120, 240, 50]
  win_lengths: [600, 1200, 240]
  window: hann
train_max_steps: 400000
win_length: 1200
window: hann
master see the word size: 1, from pid: 5087
rank: 0, pid: 5087, parent_pid: 5086
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 264, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 260, in main
    train_sp(args, config)
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 69, in train_sp
    with jsonlines.open(args.train_metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/norm/metadata.jsonl'

更改prepprcess.sh 的stage=3 stop_stage=3

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# vim local/preprocess.sh 
(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ./run.sh 
Normalize ...
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/raw/metadata.jsonl'
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/dev/raw/metadata.jsonl'
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/test/raw/metadata.jsonl'

@yt605155624
Copy link
Collaborator

那你 stage=1 stop_stage=1 的时候就没执行成功啊

@yJun-Chen
Copy link
Author

是没成功啊,我上面有发了,然后你还让我执行2和3
这是1的错误

Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 264, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 260, in main
    train_sp(args, config)
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py", line 69, in train_sp
    with jsonlines.open(args.train_metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/norm/metadata.jsonl'

@yt605155624
Copy link
Collaborator

yt605155624 commented Feb 28, 2022

你把 preprocess.sh 的代码复原,删掉本地的 dump 文件夹,重新执行 ./run.sh --stage 0 --stop-stage 0 重新预处理数据,哪个文件不存在你就看哪步没有执行成功,代码没问题,看看生成的 dump 文件里面的该有的文件都有没有

@yt605155624
Copy link
Collaborator

请检查你的 /home/jovyan/datasets/BZNSYP 里面到底有没有东西,数据预处理很简单,看看代码就能解决

@yJun-Chen
Copy link
Author

这个是/home/jovyan/datasets/BZNSYP 里面的文件
image

我从新克隆了项目下来,然后下载了 baker_alignment_tone.tar.gz
运行./run.sh --stage 0 --stop-stage 0 还是不行

(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# source path.sh
(base) root@ff21c21bf0ea:/opt/PaddleSpeech/examples/csmsc/voc1# ./run.sh --stage 0 --stop-stage 0
Generate durations.txt from MFA results ...
Extract features ...
Get features' stats ...
Traceback (most recent call last):
  File "/opt/PaddleSpeech/utils/compute_statistics.py", line 109, in <module>
    main()
  File "/opt/PaddleSpeech/utils/compute_statistics.py", line 84, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/raw/metadata.jsonl'
Normalize ...
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/train/raw/metadata.jsonl'
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/dev/raw/metadata.jsonl'
Traceback (most recent call last):
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 133, in <module>
    main()
  File "/opt/PaddleSpeech/paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/../normalize.py", line 81, in main
    with jsonlines.open(args.metadata, 'r') as reader:
  File "/opt/conda/lib/python3.8/site-packages/jsonlines/jsonlines.py", line 623, in open
    fp = builtins.open(file, mode=mode + "t", encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'dump/test/raw/metadata.jsonl'

如果可以的话,方便加个QQ交流一下吗,谢谢。qq:1668544151

@yt605155624
Copy link
Collaborator

BZNSYP 的目录结构应该如下所示

BZNSYP
├── PhoneLabeling
├── ProsodyLabeling
└── Wave

@barryhunt
Copy link

我也有相同的问题,请问解决了嘛

@xusk
Copy link

xusk commented Jun 21, 2022

我也有相同的问题,请问解决了嘛

主要是还是 wav 目录读取的问题吧

@sixyang
Copy link

sixyang commented Aug 12, 2022

我也遇到这个问题,我这边是 csmsc 数据集的问题,使用 rar 解压下来直接变成一个文件夹,乱套了,可以尝试自己在电脑上解压,然后压缩到 zip 里面再传输到服务器上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants