From 1ee45b5336bca09d2e9ff81f6f814f7bd7132f8e Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Mon, 22 Jan 2018 08:29:27 -0800 Subject: [PATCH] Change config to json 3 --- config.json | 2 +- datasets/.LJSpeech.py.swp | Bin 12288 -> 12288 bytes datasets/LJSpeech.py | 10 ++++++---- train.py | 4 +++- utils/.generic_utils.py.swp | Bin 20480 -> 20480 bytes utils/audio.py | 2 -- utils/generic_utils.py | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config.json b/config.json index 1b873b98..89a30a6b 100644 --- a/config.json +++ b/config.json @@ -25,5 +25,5 @@ "text_cleaner": "english_cleaners", "data_path": "/data/shared/KeithIto/LJSpeech-1.0", - "output_path": "./result" + "output_path": "result" } diff --git a/datasets/.LJSpeech.py.swp b/datasets/.LJSpeech.py.swp index b80a29a92f3d6b9718ebaad4e83245cb840134bf..c909a602526f2e33effeea8cdc2aa32e3061a977 100644 GIT binary patch delta 492 zcmYk&KS)AB90%~R+6^#-3L=_^7s%nI5ZTFWFzi*qOo^SL!>4YdXbkx}51 zLz}!B8l>iEYpWrlrpT6{CHwQu68v!=?swdmhDeB8M-G8>suf|{RDGKQRtZT9t3 z>9Xv6mxPGnkl!TRhDcO4{UsvYp$z1hL^KVbcA`3bz&+f-9%Nw@98k3pUBCfEK?VtG z-PnU7>;eN7TwsG*7tsscz%eX903NNBqa!O(8e%XHV-SSrPNFk7gaWL>6ik8u*BwM9 zH~|KO&<<@-u@LRRIMmH}6gnx)y6H2os<-dO8nx0ror`Td9k!8rVtoW<1 c(9?`I=H>yO5Z~6qc5iFi%dfNw-ydH20hhLF#sB~S delta 420 zcmXBQze@sf7zXh7%wL&$9xZ89w_G8XH3UL5Bt%D0YgB{Yb#@}rDdrY+LNv7mUxlLn zhmcE~B613$r66c1D5Fgp0;Q&&>V*%y@VvwOzD1>|gw`gO<`>0Sbdpd3B6n+jb$eit zjuVwoo9ARp2z>Is2Ro79`9C2uK^!u7c%lUe!<(O|39nFxYuJN0i16VfI)gOmFbgsG z_7c6o6_~IKX^>$KhN06#RD(m9fiDlyt%ppyKvRPT;t1k_kb Reading LJSpeech from - {}".format(root_dir)) print(" | > Number of instances : {}".format(len(self.frames))) def load_wav(self, filename): try: - audio = librosa.load(filename, sr=c.sample_rate) + audio = librosa.load(filename, sr=self.sample_rate) return audio except RuntimeError as e: print(" !! Cannot read file : {}".format(filename)) @@ -33,7 +35,7 @@ class LJSpeechDataset(Dataset): wav_name = os.path.join(self.root_dir, self.frames.ix[idx, 0]) + '.wav' text = self.frames.ix[idx, 1] - text = np.asarray(text_to_sequence(text, [c.cleaners]), dtype=np.int32) + text = np.asarray(text_to_sequence(text, [self.cleaners]), dtype=np.int32) wav = np.asarray(self.load_wav(wav_name)[0], dtype=np.float32) sample = {'text': text, 'wav': wav} return sample diff --git a/train.py b/train.py index 6ca1f1fe..69545300 100644 --- a/train.py +++ b/train.py @@ -42,7 +42,9 @@ def main(args): dataset = LJSpeechDataset(os.path.join(c.data_path, 'metadata.csv'), os.path.join(c.data_path, 'wavs'), - c.r + c.r, + c.sample_rate, + c.text_cleaner ) model = Tacotron(c.embedding_size, diff --git a/utils/.generic_utils.py.swp b/utils/.generic_utils.py.swp index 4b46ae8a4ffed90cb2142d9ba6881d2f6e011773..a1e0563566e8c234b82fbc063258feead788a996 100644 GIT binary patch delta 40 ucmZozz}T>WQ7FkE%+puFT+f672m}}ymhf*BYVu_?oUEaHY;&~VQbqvLnF_-I delta 40 ucmZozz}T>WQ7FkE%+puFT+f672m}}yocJ~hHTg0cP1evowmI5wDI);O5ei`d diff --git a/utils/audio.py b/utils/audio.py index 1d6b24f7..49a5bc34 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -1,8 +1,6 @@ import librosa import numpy as np from scipy import signal -import Tacotron.train_config as c - _mel_basis = None diff --git a/utils/generic_utils.py b/utils/generic_utils.py index e5fc0cb4..4a10b9a2 100644 --- a/utils/generic_utils.py +++ b/utils/generic_utils.py @@ -33,7 +33,7 @@ def remove_experiment_folder(experiment_path): """Check folder if there is a checkpoint, otherwise remove the folder""" checkpoint_files = glob.glob(experiment_path+"/*.pth.tar") - if len(checkpoint_files) < 2: + if len(checkpoint_files) < 1: shutil.rmtree(experiment_path) print(" ! Run is removed from {}".format(experiment_path)) else: