NVIDIA / tacotron2

Tacotron 2 - PyTorch implementation with faster-than-realtime inference
BSD 3-Clause "New" or "Revised" License
4.98k stars 1.37k forks source link

Can't load new model #536

Closed yasntrk closed 2 years ago

yasntrk commented 2 years ago

Hi, when i tried to load my trained model with different language i am getting this error:

RuntimeError: Error(s) in loading state_dict for Tacotron2:
    size mismatch for embedding.weight: copying a param with shape torch.Size([154, 512]) from checkpoint, the shape in current model is torch.Size([148, 512]).

this my reference notebook.

https://colab.research.google.com/github/tugstugi/dl-colab-notebooks/blob/master/notebooks/NVidia_Tacotron2_Waveglow.ipynb#scrollTo=qjKmOQha_8fS&uniqifier=1

how can i solve this problem? any idea

yasntrk commented 2 years ago

found the solution

from text import symbols
lets =      ['Ç', #change this part for your own language 
            'Ğ',
            "Ü",
            "İ",
            "Ö",
            "Ş",
            "ç",
            "ü",
            "ö",
            "ğ",
            "ı",
            "ş"]

unwanted = ["Q",
            "q",
            "W",
            "w",
            "X",
            "x",]

for letters in lets:
  symbols.append(letters)
for unwanteds in unwanted:
  symbols.remove(unwanteds)

worked for me