Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add VITS-2 #1510

Closed
wants to merge 9 commits into from
Closed

[WIP] Add VITS-2 #1510

wants to merge 9 commits into from

Conversation

ezerhouni
Copy link
Collaborator

Add VITS-2 Recipe for LJSpeech.
For the moment, I am facing a bug tracked here :
#1508

I will add the License etc later on, once the PR work

@csukuangfj
Copy link
Collaborator

Does torch.min(inputs, dim=None) work for you?

@ezerhouni
Copy link
Collaborator Author

ezerhouni commented Feb 20, 2024

For now, I am getting

  File "/vits2/egs/ljspeech/TTS/vits2/transform.py", line 118, in rational_quadratic_spline
    if torch.min(inputs, dim=None) < left or torch.max(inputs) > right:
RuntimeError: Please look up dimensions by name, got: name = None.

Debugging as we speak

Edit: The previous crash happened at epoch 918. I think it might come from the transformer layer I am adding

@csukuangfj
Copy link
Collaborator

What is the output of

print(type(inputs))

@ezerhouni
Copy link
Collaborator Author

What is the output of

print(type(inputs))

<class 'torch.Tensor'>

@csukuangfj
Copy link
Collaborator

As a last attempt, could you replace

torch.min(inputs, dim=None)

with

torch.min(inputs.reshape(-1), dim=0)

I just searched for the new error, and found
pytorch/pytorch#70925

Not sure if inputs is a named tensor.

@ezerhouni
Copy link
Collaborator Author

@csukuangfj Thanks for your help, I have replaced by:

    if torch.min(inputs.reshape(-1), dim=0)[0] < left or torch.max(inputs.reshape(-1), dim=0)[0] > right:
        raise ValueError("Input to a transform is not within its domain")

and it seems to run. It takes ~ 24h on my machine to train a model for 1000 epochs. I will let you know once the training is done

xa, xb = x.split(x.size(1) // 2, dim=1)

x_trans_mask = make_pad_mask(torch.sum(x_mask, dim=[1, 2]).type(torch.int64))
xa_ = self.pre_transformer(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csukuangfj I will try to debug more, but I think the issue might comes from there

@ezerhouni
Copy link
Collaborator Author

@csukuangfj I tried with the fix that you proposed and with the new tokenization, both throw the same error.

@csukuangfj
Copy link
Collaborator

Could you check that inputs is not empty in

    if torch.min(inputs.reshape(-1), dim=0)[0] < left or torch.max(inputs.reshape(-1), dim=0)[0] > right:

?

If it is empty, could you find why it is empty?

@ezerhouni
Copy link
Collaborator Author

@csukuangfj The training works fine. The quality is not optimal for the moment, so I am playing a bit with the parameters and will let you know

@ezerhouni
Copy link
Collaborator Author

@csukuangfj I am still having issues to train a model. I will close this PR and re-open one once I have a more stable branch.

@ezerhouni ezerhouni closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants