diff --git a/train.py b/train.py index 16660a11..5c45181b 100644 --- a/train.py +++ b/train.py @@ -94,7 +94,10 @@ def train(model, criterion, criterion_st, optimizer, optimizer_st, scheduler, avg_step_time = 0 avg_loader_time = 0 print("\n > Epoch {}/{}".format(epoch, c.epochs), flush=True) - batch_n_iter = int(len(data_loader.dataset) / (c.batch_size * num_gpus)) + if use_cuda: + batch_n_iter = int(len(data_loader.dataset) / (c.batch_size * num_gpus)) + else: + batch_n_iter = int(len(data_loader.dataset) / c.batch_size) end_time = time.time() for num_iter, data in enumerate(data_loader): start_time = time.time() @@ -423,7 +426,7 @@ def evaluate(model, criterion, criterion_st, ap, global_step, epoch): model, test_sentence, c, use_cuda, ap, speaker_id=speaker_id, style_wav=style_wav) - file_path = os.path.join(AUDIO_PATH, str(current_step)) + file_path = os.path.join(AUDIO_PATH, str(global_step)) os.makedirs(file_path, exist_ok=True) file_path = os.path.join(file_path, "TestSentence_{}.wav".format(idx)) diff --git a/utils/text/__init__.py b/utils/text/__init__.py index 77cc23a5..226e2e8d 100644 --- a/utils/text/__init__.py +++ b/utils/text/__init__.py @@ -17,7 +17,7 @@ _ID_TO_PHONEMES = {i: s for i, s in enumerate(phonemes)} # Regular expression matching text enclosed in curly braces: _CURLY_RE = re.compile(r'(.*?)\{(.+?)\}(.*)') -# Regular expression matchinf punctuations, ignoring empty space +# Regular expression matching punctuations, ignoring empty space PHONEME_PUNCTUATION_PATTERN = r'['+_phoneme_punctuations+']+'