tuanh123789 / Train_Hifigan_XTTS

This is an implementation for train hifigan part of XTTSv2 model using Coqui/TTS.
54 stars 18 forks source link

Missing model state_dict when run test.py #9

Closed mpquochung closed 3 weeks ago

mpquochung commented 3 weeks ago

After trained a few epoch, I take some checkpoint to try out the model but when loading the model it appears to be missing some key on model checkpoint? I took a look at both hifigan checkpoint and gpt checkpoint and compare but can not see the layers missing in the picture 2.

image image

Here is the path I put in the Inferer, I am using kaggle to train. The model I took was on ViXTTS Huggingface:

class Inferer:
    def __init__(self):
        # Add here the xtts_config path
        self.xtts_config_path = "/kaggle/working/config.json"
        # Add here the vocab file that you have used to train the model
        self.tokenizer_path = "/kaggle/input/vixtts/pytorch/default/1/vocab.json"
        # Add here the checkpoint that you want to do inference with
        self.xtts_checkpoint = "/kaggle/input/vixtts/pytorch/default/1/model.pth"
        # Add here the speaker reference
        self.speaker_reference = ["/kaggle/working/Train_Hifigan_XTTS/Infore_latents/wavs/1.wav"]
        self.hifigan_checkpoint_path = "/kaggle/temp/outputs/run-August-24-2024_12+30PM-04202fc/best_model.pth"
        self.hifigan_config = GPTHifiganConfig()

        self.hifigan_generator = self.load_hifigan_generator()
        self.model = self.load_xtts_checkpoint()
mpquochung commented 3 weeks ago

ah yes I figure it out, the config.json file must be the config file from original XTTS-v2 model not the config.json generated when fine-tuning.