coqui-ai / TTS

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production
http://coqui.ai
Mozilla Public License 2.0
35.09k stars 4.28k forks source link

[Bug] #2642

Closed souvikg544 closed 1 year ago

souvikg544 commented 1 year ago

Describe the bug

Problem when running yourtts training recipe with use_phonemes=True

Error -


> TRAINING (2023-05-30 17:28:48) 
 ! Run is kept in /newvolume/souvik/yourtts_exp/TTS/recipes/vctk/yourtts/YourTTS-EN-VCTK-May-30-2023_05+28PM-2071088b
Traceback (most recent call last):
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/trainer/trainer.py", line 1591, in fit
    self._fit()
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/trainer/trainer.py", line 1544, in _fit
    self.train_epoch()
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/trainer/trainer.py", line 1308, in train_epoch
    for cur_step, batch in enumerate(self.train_loader):
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 634, in __next__
    data = self._next_data()
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1346, in _next_data
    return self._process_data(data)
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
    data.reraise()
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/_utils.py", line 644, in reraise
    raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
    data = fetcher.fetch(index)
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/newvolume/souvik/yourtts_exp/TTS/TTS/tts/models/vits.py", line 272, in __getitem__
    token_ids = self.get_token_ids(idx, item["text"])
  File "/newvolume/souvik/yourtts_exp/TTS/TTS/tts/datasets/dataset.py", line 240, in get_token_ids
    token_ids = self.get_phonemes(idx, text)["token_ids"]
  File "/newvolume/souvik/yourtts_exp/TTS/TTS/tts/datasets/dataset.py", line 217, in get_phonemes
    out_dict = self.phoneme_dataset[idx]
  File "/newvolume/souvik/yourtts_exp/TTS/TTS/tts/datasets/dataset.py", line 607, in __getitem__
    ids = self.compute_or_load(string2filename(item["audio_unique_name"]), item["text"], item["language"])
  File "/newvolume/souvik/yourtts_exp/TTS/TTS/tts/datasets/dataset.py", line 620, in compute_or_load
    cache_path = os.path.join(self.cache_path, file_name + file_ext)
  File "/newvolume/anaconda3/envs/yourtts/lib/python3.9/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

To Reproduce

Run the same code just change use_phonemes=True in vits config

Expected behavior

Should have ran by using phonemes.

Logs

No response

Environment

Updated tts version

Additional context

No response

nikosanto13 commented 1 year ago

@souvikg544 You didn't specify a path for phoneme_cache_path key in your config, which is mandatory if you set use_phonemes to True.

souvikg544 commented 1 year ago

Thanks @nikosanto13 .. Now during evaluation I get the error - local variable 'outputs' referenced before assignment .... Full details are mentioned here - https://github.com/coqui-ai/TTS/issues/2631 ...