File "C:\Users\82109\anaconda3\envs\coqui_tts\lib\site-packages\torch\functional.py", line 604, in stft
    input = F.pad(input.view(extended_shape), [pad, pad], pad_mode)
RuntimeError: Argument #4: Padding size should be less than the corresponding input dimension, but got: padding (256, 256)
 at dimension 2 of input [1, 10, 22]

나의 경우 음성 합성을 할 때, embedding과정에서 이러한 오류가 발생했다.

 

https://github.com/NVIDIA/tacotron2/issues/113

 

Argument #4: Padding size should be less than the corresponding input dimension · Issue #113 · NVIDIA/tacotron2

I am seeing this error: Argument #4: Padding size should be less than the corresponding input dimension, but got: padding (512, 512) at dimension 3 of input [1, 1, 1, 220] after trying to train usi...

github.com

위의 issue를 참고해서, 원인을 파악해 보았더니 원인은 매우 짧은 wav파일들 때문에 padding에 오류가 생긴 것 같다.

오류가 나는 %와 진행도를 바탕으로 오류가 나는 wav파일을 찾아보니, 그 파일의 길이가 0.0004초였다..

전체 wav파일 중 극단적으로 짧은 wav파일들을 삭제하고 다시 embedding을 진행하니, 위와 같은 오류가 발생하지 않았다.