CSTR-Edinburgh / merlin

This is now the official location of the Merlin project.
http://www.cstr.ed.ac.uk/projects/merlin/
Apache License 2.0
1.31k stars 441 forks source link

Merlin guide for creating training labels for own voice? #167

Closed reiinakano closed 7 years ago

reiinakano commented 7 years ago

Is there a more comprehensive guide for using your own .wav files to generate alignment training labels?

I honestly have no clue how to make it work for my own data. The scripts in https://github.com/CSTR-Edinburgh/merlin/tree/master/misc/scripts/alignment/state_align and https://github.com/CSTR-Edinburgh/merlin/tree/master/misc/scripts/alignment/phone_align seem to be hardcoded just for cmu_arctic.

Also, I can't even run the default scripts properly on the hardcoded cmu_arctic data. For phone_aligner, it just errors with this traceback.

for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0520.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0520.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0521.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0521.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0522.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0522.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0523.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0523.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0524.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0524.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0525.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0525.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0526.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0526.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0527.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0527.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0528.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0528.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0529.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0529.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0530.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0530.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0531.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0531.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0532.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0532.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0533.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0533.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0534.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0534.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0535.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0535.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0536.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0536.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0537.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0537.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0538.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0538.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0539.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0539.slehmm' for reading (No such file or directory)

WARNING
No default voice found in ("/home/ubuntu/pynb/TFplay/merlin/tools/festival/lib/voices/")
either no voices unpacked or voice-path is wrong
Scheme interpreter will work, but there is no voice to speak with.
WARNING

SIOD ERROR: could not open file /projects/festival/lib/dicts/cmu/cmulex.scm
closing a file left open: ./festvox/cmu_us_slt_arctic_lexicon.scm
closing a file left open: festvox/cmu_us_slt_arctic_clunits.scm
closing a file left open: festvox/build_clunits.scm
converting festival utts to labels...
cmuarctic.data cmu_us_slt_arctic config.cfg file_id_list.scp full-context-labels README.md run_aligner.sh setup.sh slt_wav slt_wav.zip
gawk: fatal: cannot open file `full-context-labels/tmp' for reading (No such file or directory)
gawk: fatal: cannot open file `full-context-labels/tmp' for reading (No such file or directory)
normalizing label files for merlin...
arctic_a0001.lab
Traceback (most recent call last):
  File "/home/ubuntu/pynb/TFplay/merlin/misc/scripts/frontend/utils/normalize_lab_for_merlin.py", line 131, in <module>
    normalize_label_files(in_lab_file, out_lab_file, label_style, write_time_stamps)
  File "/home/ubuntu/pynb/TFplay/merlin/misc/scripts/frontend/utils/normalize_lab_for_merlin.py", line 35, in normalize_label_files
    in_f = open(in_lab_file,'r')
IOError: [Errno 2] No such file or directory: 'full-context-labels/full/arctic_a0001.lab'

For state_aligner, here is the error

Step 1: creating label files from text...
creating a scheme file from text file
generating utts from scheme file

WARNING
No default voice found in ("/home/ubuntu/pynb/TFplay/merlin/tools/festival/lib/voices/")
either no voices unpacked or voice-path is wrong
Scheme interpreter will work, but there is no voice to speak with.
WARNING

-=-=-=-=-=- EST Error -=-=-=-=-=-
{FND} Feature Token_Method not defined

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
closing a file left open: /home/ubuntu/pynb/TFplay/merlin/misc/scripts/alignment/state_align/cmuarctic.scm
converting festival utts to labels...
binary_io.py cmuarctic.data cmuarctic.scm config config.cfg file_id_list.scp forced_alignment.py htk_io.py htk_io.pyc htkmfc.py htkmfc.pyc label_no_align mean_variance_norm.py mean_variance_norm.pyc mfc model mono_no_align mono_phone.list phoneme_map.dict prepare_labels_from_txt.sh prompt-lab prompt-utt README.md run_aligner.sh setup.sh slt_wav slt_wav.zip
gawk: fatal: cannot open file `/home/ubuntu/pynb/TFplay/merlin/misc/scripts/alignment/state_align/prompt-lab/tmp' for reading (No such file or directory)
gawk: fatal: cannot open file `/home/ubuntu/pynb/TFplay/merlin/misc/scripts/alignment/state_align/prompt-lab/tmp' for reading (No such file or directory)
normalizing label files for merlin...
arctic_a0001.lab
Traceback (most recent call last):
  File "/home/ubuntu/pynb/TFplay/merlin/misc/scripts/frontend/utils/normalize_lab_for_merlin.py", line 131, in <module>
    normalize_label_files(in_lab_file, out_lab_file, label_style, write_time_stamps)
  File "/home/ubuntu/pynb/TFplay/merlin/misc/scripts/frontend/utils/normalize_lab_for_merlin.py", line 35, in normalize_label_files
    in_f = open(in_lab_file,'r')
IOError: [Errno 2] No such file or directory: '/home/ubuntu/pynb/TFplay/merlin/misc/scripts/alignment/state_align/prompt-lab/full/arctic_a0001.lab'
Labels are ready in: /home/ubuntu/pynb/TFplay/merlin/misc/scripts/alignment/state_align/label_no_align !!
Step 2: forced-alignment using HTK tools...
---preparing enverionment
---checking data
---extracting features
Traceback (most recent call last):
  File "forced_alignment.py", line 376, in <module>
    aligner.prepare_training(file_id_list_name, wav_dir, lab_dir, work_dir, multiple_speaker)
  File "forced_alignment.py", line 250, in prepare_training
    self._HCopy()
  File "forced_alignment.py", line 188, in _HCopy
    check_call([HCopy, '-C', self.cfg, '-S', self.copy_scp])
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

A full guide to using my own .wav files with Merlin would be appreciated.

bajibabu commented 7 years ago

Did you install the festival properly? You need to install some default voices along with the festival to generate the utt files from the txt.

reiinakano commented 7 years ago

Hmm, I was able to build Festival, but am not sure how to install the default voices.

bajibabu commented 7 years ago

Download the voices from here http://festvox.org/packed/festival/2.4/voices/ and unzip them in your festival folder. You can check the installed voices in this location festival/lib/voices/

reiinakano commented 7 years ago

Thank you! I'll try it and update this issue.

Anyway, is there any instruction available on how to use my own wav files for state_align or phone_align?

bajibabu commented 7 years ago

You can follow the steps mentioned in this exercise to build your own voice http://www.speech.zone/exercises/build-your-own-dnn-voice/

reiinakano commented 7 years ago

I unzipped the festvox_kallpc16k.tar.gz voice and am able to find the voice in festival/lib/voices.

The warning of "no default voice" is now gone, but the error still persists.

mv: cannot stat 'lab/arctic_b0535.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0535.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0536.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0536.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0537.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0537.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0538.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0538.slehmm' for reading (No such file or directory)
mv: cannot stat 'lab/arctic_b0539.sl': No such file or directory
awk: etc/mapstatenames.awk:1: fatal: cannot open file `lab/arctic_b0539.slehmm' for reading (No such file or directory)
SIOD ERROR: could not open file /projects/festival/lib/dicts/cmu/cmulex.scm
closing a file left open: /home/ubuntu/pynb/TFplay/merlin/tools/festival/lib/voices/english/kal_diphone/festvox/kal_diphone.scm
closing a file left open: /home/ubuntu/pynb/TFplay/merlin/tools/festival/lib/init.scm
festival: fatal error exiting.
converting festival utts to labels...
cmuarctic.data cmu_us_slt_arctic config.cfg file_id_list.scp full-context-labels README.md run_aligner.sh setup.sh slt_wav slt_wav.zip
gawk: fatal: cannot open file `full-context-labels/tmp' for reading (No such file or directory)
gawk: fatal: cannot open file `full-context-labels/tmp' for reading (No such file or directory)
normalizing label files for merlin...
arctic_a0001.lab
Traceback (most recent call last):
  File "/home/ubuntu/pynb/TFplay/merlin/misc/scripts/frontend/utils/normalize_lab_for_merlin.py", line 131, in <module>
    normalize_label_files(in_lab_file, out_lab_file, label_style, write_time_stamps)
  File "/home/ubuntu/pynb/TFplay/merlin/misc/scripts/frontend/utils/normalize_lab_for_merlin.py", line 35, in normalize_label_files
    in_f = open(in_lab_file,'r')
IOError: [Errno 2] No such file or directory: 'full-context-labels/full/arctic_a0001.lab'
bajibabu commented 7 years ago

It looks like you installed the festival in this path "/home/ubuntu/pynb/TFplay/merlin/tools/festival/" but why is that it trying to load the cmulex.scm from this path? SIOD ERROR: could not open file /projects/festival/lib/dicts/cmu/cmulex.scm

reiinakano commented 7 years ago

I actually have no clue. Is there some environment variable or config I should be setting?

reiinakano commented 7 years ago

UPDATE: I added cmulex.scm + all other required files to /home/ubuntu/pynb/TFplay/merlin/tools/festival/lib/dicts/cmu/cmulex.scm. This worked. For some reason that doesn't make sense to me, /projects/ is an alias for path-to-here.

bajibabu commented 7 years ago

Good to know that you find the solution.