mirror of https://github.com/coqui-ai/TTS.git
TTSDataset.py fixes and updates for existing phoneme folder in nultiprocessing
This commit is contained in:
parent
618b280812
commit
cc34fe4c7c
4
.compute
4
.compute
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
ls ${SHARED_DIR}/data/keithito
|
||||||
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl
|
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl
|
||||||
yes | apt-get install espeak
|
yes | apt-get install espeak
|
||||||
python3 setup.py develop
|
python3 setup.py develop
|
||||||
python3 train.py --config_path config_cluster.json --data_path ${SHARED_DIR}/data/Blizzard/Nancy/ --debug true
|
# python3 distribute.py --config_path config_cluster.json --data_path ${SHARED_DIR}/data/keithito/LJSpeech-1.1/ --restore_path ${USER_DIR}/best_model.pth.tar
|
||||||
|
python3 distribute.py --config_path config_cluster.json --data_path ${SHARED_DIR}/data/keithito/LJSpeech-1.1/
|
|
@ -65,7 +65,7 @@ class MyDataset(Dataset):
|
||||||
self.phoneme_language = phoneme_language
|
self.phoneme_language = phoneme_language
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
if use_phonemes and not os.path.isdir(phoneme_cache_path):
|
if use_phonemes and not os.path.isdir(phoneme_cache_path):
|
||||||
os.makedirs(phoneme_cache_path)
|
os.makedirs(phoneme_cache_path, exist_ok=True)
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print("\n > DataLoader initialization")
|
print("\n > DataLoader initialization")
|
||||||
print(" | > Data path: {}".format(root_path))
|
print(" | > Data path: {}".format(root_path))
|
||||||
|
@ -91,7 +91,15 @@ class MyDataset(Dataset):
|
||||||
file_name = os.path.basename(wav_file).split('.')[0]
|
file_name = os.path.basename(wav_file).split('.')[0]
|
||||||
tmp_path = os.path.join(self.phoneme_cache_path, file_name+'_phoneme.npy')
|
tmp_path = os.path.join(self.phoneme_cache_path, file_name+'_phoneme.npy')
|
||||||
if os.path.isfile(tmp_path):
|
if os.path.isfile(tmp_path):
|
||||||
text = np.load(tmp_path)
|
try:
|
||||||
|
text = np.load(tmp_path)
|
||||||
|
except:
|
||||||
|
print(" > ERROR: phoneme connot be loaded for {}. Recomputing.".format(wav_file))
|
||||||
|
text = np.asarray(
|
||||||
|
phoneme_to_sequence(
|
||||||
|
text, [self.cleaners], language=self.phoneme_language),
|
||||||
|
dtype=np.int32)
|
||||||
|
np.save(tmp_path, text)
|
||||||
else:
|
else:
|
||||||
text = np.asarray(
|
text = np.asarray(
|
||||||
phoneme_to_sequence(text, [self.cleaners], language=self.phoneme_language), dtype=np.int32)
|
phoneme_to_sequence(text, [self.cleaners], language=self.phoneme_language), dtype=np.int32)
|
||||||
|
|
Loading…
Reference in New Issue