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

RuntimeError at the inference time #7

Open
Charlottecuc opened this issue Nov 16, 2020 · 2 comments
Open

RuntimeError at the inference time #7

Charlottecuc opened this issue Nov 16, 2020 · 2 comments

Comments

@Charlottecuc
Copy link

Charlottecuc commented Nov 16, 2020

Hi. I trained the DurIAN model using a Mandarin dataset and modified text_frontend.py a little bit.
However, at the inference time, I encountered the following problem:

Traceback (most recent call last):
  File "inference.py", line 56, in <module>
    test()
  File "inference.py", line 48, in test
    outputs = model.inference(inputs)
  File "/models/DurIAN-ivanvok/model/model.py", line 91, in inference
    alignments, _ = self.duration_model.inference(inputs)
  File "/models/DurIAN-ivanvok/model/duration.py", line 88, in inference
    outputs, durations = self._compute_weighted_forced_alignment(outputs[0])
  File "/models/DurIAN-ivanvok/model/duration.py", line 47, in _compute_weighted_forced_alignment
    durations = torch.bincount(alignment.argmax(dim=0))
RuntimeError: cannot perform reduction function argmax on a tensor with no elements because the operation does not have an identity

I printed the value of outputs[0].sum(dim=0):

tensor([1.7232e-08, 1.7707e-08, 2.1013e-08,  ..., 1.3151e+01, 1.5982e+01,
        1.9016e+01])

And I also printed the value of eos_idx, which is zero.

Could you tell me what is eos_idx = list((outputs[0].sum(dim=0) > 0.1).cpu().numpy()).index(False) used for, and how to solve the above problem? Thank you very much!

@ivanvovk
Copy link
Owner

ivanvovk commented Nov 18, 2020

@Charlottecuc how did you solved the alignment issue? As BCE or MSE? The line you pointed finds the end of sequence in alignment map.

@Charlottecuc
Copy link
Author

Hi @ivanvovk Thank you very much for your reply. I used MFA to extract alignment information of my data. For the 'alignment issue', I'm not quite sure what are you referring to..
Besides, could you tell me what's the exact meaning of "outputs[0].sum(dim=0) > 0.1" ? Thank you very much~

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

No branches or pull requests

2 participants