NVIDIA / tacotron2

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

Error when pasting Trained Model into Synthesis Notebook Tacotron 2 #540

Open BinaryBat2020 opened 2 years ago

BinaryBat2020 commented 2 years ago

So I'm trying to create my own deepfake audio model using Tacotron 2. I have successfully created the trained model (I think because there were no errors) using Tacotron 2 and google collab. However, when loading my trained model into the synthesis notebook, I start running into several errors that I don't know how to solve.

NameError: name 'initilized' is not defined

RuntimeError Traceback (most recent call last)

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

I have no idea how to diagnose the problem or solve these errors and there is very little material on how to solve errors when creating Tacotron deepfake audio models. Feel free to use the link to the model and paste it in the synthesis notebook and look at the errors for yourself as it might be easier to see the errors hands-on. It's a simple test model of Drake the rapper. All you are supposed to do is paste the address of the pre-trained model in the synthesis notebook and hit the play button, but when I do so it gives me the errors. Perhaps there is something wrong with my trained model although I received no errors when making it. Any help or feedback would be greatly appreciated.

Training notebook: https://colab.research.google.com/drive/14X73UiywnoL9VS30iPDcX4WXxwZWv2e2

Synthesis notebook: https://colab.research.google.com/drive/1PZ4andZVFc8YALmhBbBB3AJghLN0r8zb

Trained model: 1-8ZQb5uFFR4AtzmYoq_cZFADytuNOEyn

conceptofmind commented 2 years ago

Edit 1: This videos states the notebook you listed is broken. Try checking it out: https://www.youtube.com/watch?v=XLt_K_692Mc

Edit 2: It seems like this section of the code is throwing the error:

` def get_Tactron2(MODEL_ID):

Download Tacotron2

        tacotron2_pretrained_model = 'MLP'
        gdown.download(d+MODEL_ID, tacotron2_pretrained_model, quiet=False)
        if not exists(tacotron2_pretrained_model):
            raise Exception("Tacotron2 model failed to download!")`

I would comment it out the lines:

`#gdown.download(d+MODEL_ID, tacotron2_pretrained_model, quiet=False)

if not exists(tacotron2_pretrained_model):

raise Exception("Tacotron2 model failed to download!")`

And change:

tacotron2_pretrained_model = 'MLP'

To the drive path of your model in colab.

That error likely relates to how the torchscript model was saved and loaded. It also may have to do with the directory structure of your file paths. How are you feeding the loaded model to the script in the notebook? The author of the notebook has a initialize variable defined in a try-except loop. It throws the name error if the model does not make it through all of the predefined functions correctly. Your file may be the problem as well. It may be corrupted. Try creating it again.

As a side note, I am going through the notebooks and will see if I can reproduce the same error.