aedocw / epub2tts

Turn an epub or text file into an audiobook
Apache License 2.0
511 stars 46 forks source link

Dimension out of range error #1

Closed Tymme closed 1 year ago

Tymme commented 1 year ago

I have a book that ends up throwing an error when trying to encode it.

There's an odd bit of markup/regex/something in the middle of the chapter (|\xa0\xa0|\xa0\xa0|\xa0\xa0|\xa0\xa0|\xa0\xa0|\xa0\xa0|\xa0\xa0|\xa0\xa0|) which I'm guessing is causing the issue?

Here's the error output:

Traceback (most recent call last):
  File "/home/tymme/epub2tts/epub2tts.py", line 72, in <module>
    tts.tts_to_file(text=chapters_to_read[i], speaker='p307', file_path=outputwav)
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/TTS/api.py", line 220, in tts_to_file
    wav = self.tts(text=text, speaker=speaker, language=language, speaker_wav=speaker_wav)
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/TTS/api.py", line 183, in tts
    wav = self.synthesizer.tts(
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/TTS/utils/synthesizer.py", line 276, in tts
    outputs = synthesis(
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/TTS/tts/utils/synthesis.py", line 213, in synthesis
    outputs = run_model_torch(
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/TTS/tts/utils/synthesis.py", line 50, in run_model_torch
    outputs = _func(
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/tymme/epub2tts/lib/python3.10/site-packages/TTS/tts/models/vits.py", line 1147, in inference
    attn = generate_path(w_ceil.squeeze(1), attn_mask.squeeze(1).transpose(1, 2))
IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 2)
aedocw commented 1 year ago

I've had the same thing happen, and have been trying to find which characters or markup cause it. I'm adding in a filter to pull out characters that might be causing this. For instance with another book I was testing it seemed that it choked on "[" or "]".

adding the following seemed to fix it for this case: text = text.translate({ord(c): None for c in '[]'})

aedocw commented 1 year ago

And now I can't reliably reproduce it. The exact same chapter that seemed to trigger this error worked perfectly the second time through.

Tymme commented 1 year ago

I had one reliably error out multiple times, but was testing it to find which chapter and it's running without errors. If I find one that continually causes problems, I'll attach it.

aedocw commented 1 year ago

If you find a chapter that does error reliably, can you try adding suspicious characters to line 55 and see if that fixes it? That line removes "[" and "]", and any other character you throw in there should be stripped.

2600box commented 1 year ago

I have this too, running the docker. No odd characters as such, but the book does have special formatting for reading signs on doors which could be it?

Edit: After retrying it fails at an earlier chapter...

Tymme commented 1 year ago

If you find a chapter that does error reliably

That's the frustrating part- I would if I had something. Ihave used it a number of times since and there's nothing to make it reliably break. If a book breaks at chapter 8, I could redo 8-17 with no issue, could redo 1-17 with no issue, could redo 1-17 and it breaks at 6 instead.

I've just been re-running the script starting at the broken chapter with about 80% success rate of finishing the book the second pass through.

2600box commented 1 year ago

It failed again quite spectacularly! same book

uses, and objects, and beliefs. And I don’t think we should just stand back and allow people to be trampled on. I mean, what’s democracy for, after all?’', 'Jack said, ‘Yes, that’s all very well, but what I’m getting at is, do you think Davy should’ve gone to Spain with those two m']
['<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'd', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 'ʃ', '<BLNK>', 'ᵻ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'ʌ', '<BLNK>', 'v', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'l', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ʃ', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'h', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'm', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'ː', '<BLNK>', 'ɹ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'f', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'ː', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ː', '<BLNK>', 'ɹ', '<BLNK>', 'k', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'ː', '<BLNK>', 's', '<BLNK>', 'ɪ', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'l', '<BLNK>', 'ə', '<BLNK>', 'd', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 't', '<BLNK>', 'ɹ', '<BLNK>', 'u', '<BLNK>', 'ː', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'd', '<BLNK>', 'ɪ', '<BLNK>', 'ʃ', '<BLNK>', 'ᵻ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'p', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 'ŋ', '<BLNK>', ' ', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 'n', '<BLNK>', 'i', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'w', '<BLNK>', 'ɪ', '<BLNK>', 't', '<BLNK>', 'ʃ', '<BLNK>', 'ᵻ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'ʌ', '<BLNK>', 'v', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ʃ', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ʌ', '<BLNK>', 'v', '<BLNK>', ' ', '<BLNK>', 'ˈ', '<BLNK>', 'ɛ', '<BLNK>', 'ɡ', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'ɛ', '<BLNK>', 'ɾ', '<BLNK>', 'ɪ', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'm', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ʌ', '<BLNK>', 'v', '<BLNK>', ' ', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'ɛ', '<BLNK>', 'm', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 'ɾ', '<BLNK>', 'ɚ', '<BLNK>', ' ', '<BLNK>', 'f', '<BLNK>', 'ɚ', '<BLNK>', 'ð', '<BLNK>', 'ə', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ʃ', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 'l', '<BLNK>', 'd', '<BLNK>', 'ɹ', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'f', '<BLNK>', 'ˈ', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'i', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ʌ', '<BLNK>', 'l', '<BLNK>', 't', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'n', '<BLNK>', 'ə', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'd', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'b', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'i', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'ɹ', '<BLNK>', 't', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'p', '<BLNK>', 'ə', '<BLNK>', 'l', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'ɹ', '<BLNK>', 't', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'm', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'ɹ', '<BLNK>', 't', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', 'l', '<BLNK>', 'ɪ', '<BLNK>', 't', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'w', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'k', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'n', '<BLNK>', 'ɐ', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'l', '<BLNK>', 'ɪ', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'm', '<BLNK>', 'ɪ', '<BLNK>', 'ŋ', '<BLNK>', 't', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', 'z', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ʌ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 's', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'm', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'd', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'ə', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 's', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 's', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'ɹ', '<BLNK>', 'ə', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'k', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'm', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'ː', '<BLNK>', 's', '<BLNK>', 'ɪ', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ' ', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'l', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'f', '<BLNK>', 'i', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'l', '<BLNK>', 'z', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ʌ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'ɐ', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'm', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɐ', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ʃ', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'k', '<BLNK>', 'l', '<BLNK>', 'ə', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɐ', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ˈ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'k', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', 'ˌ', '<BLNK>', 'ʌ', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɐ', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'ɹ', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', 'ˈ', '<BLNK>', 'ɛ', '<BLNK>', 'l', '<BLNK>', 'ɪ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'w', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 'f', '<BLNK>', 'ə', '<BLNK>', 'l', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'n', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', 'ː', '<BLNK>', 'l', '<BLNK>', 'ɪ', '<BLNK>', 't', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'l', '<BLNK>', 'ˈ', '<BLNK>', 'ɑ', '<BLNK>', '̃', '<BLNK>', 'ŋ', '<BLNK>', 'k', '<BLNK>', ' ', '<BLNK>', 'm', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', 'ʒ', '<BLNK>', 'ᵻ', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'f', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'u', '<BLNK>', 'ː', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'l', '<BLNK>', 'ə', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'k', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'm', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ɐ', '<BLNK>', 'n', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'ə', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'ʃ', '<BLNK>', 'ə', '<BLNK>', 'n', '<BLNK>', ' ', '<BLNK>', 'f', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'u', '<BLNK>', 'ː', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'p', '<BLNK>', 'ˈ', '<BLNK>', 'a', '<BLNK>', 'ɪ', '<BLNK>', 'n', '<BLNK>', 'æ', '<BLNK>', 'p', '<BLNK>', 'ə', '<BLNK>', 'l', '<BLNK>', 'z', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 't', '<BLNK>', 'ʃ', '<BLNK>', 'ˈ', '<BLNK>', 'i', '<BLNK>', 'ː', '<BLNK>', 'z', '<BLNK>', ' ', '<BLNK>', 's', '<BLNK>', 't', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'ɔ', '<BLNK>', 'ː', '<BLNK>', 'z', '<BLNK>', ',', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ð', '<BLNK>', 'ɛ', '<BLNK>', 'ɹ', '<BLNK>', 'w', '<BLNK>', 'ˌ', '<BLNK>', 'ɜ', '<BLNK>', 'ː', '<BLNK>', ' ', '<BLNK>', 'm', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 'l', '<BLNK>', 'k', '<BLNK>', ' ', '<BLNK>', 'ˈ', '<BLNK>', 'æ', '<BLNK>', 'ɹ', '<BLNK>', 'o', '<BLNK>', 'ʊ', '<BLNK>', 'ɹ', '<BLNK>', 'ˌ', '<BLNK>', 'u', '<BLNK>', 'ː', '<BLNK>', 't', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ˈ', '<BLNK>', 'ɪ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 'ɪ', '<BLNK>', 't', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'æ', '<BLNK>', 'n', '<BLNK>', 'd', '<BLNK>', ' ', '<BLNK>', 'ɹ', '<BLNK>', 'ˈ', '<BLNK>', 'ʌ', '<BLNK>', 's', '<BLNK>', 'k', '<BLNK>', 's', '<BLNK>', ' ', '<BLNK>', 'f', '<BLNK>', 'ɚ', '<BLNK>', 'ð', '<BLNK>', 'ə', '<BLNK>', ' ', '<BLNK>', 'b', '<BLNK>', 'ˈ', '<BLNK>', 'e', '<BLNK>', 'ɪ', '<BLNK>', 'b', '<BLNK>', 'i', '<BLNK>', 'z', '<BLNK>', '.', '<BLNK>']
 [!] Character '̃' not found in the vocabulary. Discarding it.
Traceback (most recent call last):
  File "/opt/epub2tts/epub2tts.py", line 82, in <module>
    tts.tts_to_file(text=chapters_to_read[i], speaker='p335', file_path=outputwav)
  File "/usr/local/lib/python3.10/dist-packages/TTS/api.py", line 220, in tts_to_file
    wav = self.tts(text=text, speaker=speaker, language=language, speaker_wav=speaker_wav)
  File "/usr/local/lib/python3.10/dist-packages/TTS/api.py", line 183, in tts
    wav = self.synthesizer.tts(
  File "/usr/local/lib/python3.10/dist-packages/TTS/utils/synthesizer.py", line 276, in tts
    outputs = synthesis(
  File "/usr/local/lib/python3.10/dist-packages/TTS/tts/utils/synthesis.py", line 213, in synthesis
    outputs = run_model_torch(
  File "/usr/local/lib/python3.10/dist-packages/TTS/tts/utils/synthesis.py", line 50, in run_model_torch
    outputs = _func(
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/TTS/tts/models/vits.py", line 1147, in inference
    attn = generate_path(w_ceil.squeeze(1), attn_mask.squeeze(1).transpose(1, 2))
IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 2)
aedocw commented 1 year ago

This is something happening inside Coqui-TTS, and in my experience it's been pretty random. It will happen once, then I try again with the same chapter and it works great the next time. I'll keep an eye on it but until we find some copy that reliably produces the bug there's not much we can do. Definitely appreciate you all sharing what you're running in to here though, thank you!

aedocw commented 1 year ago

Closing this for now as I have not run into this issue in the last 40 books I've run through this. Happy to re-open if there's detectable copy we can do something to (i.e. strip or replace specific characters, etc)