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

build_waitk_mask does not exist #1

Open
mako2sake opened this issue Oct 20, 2023 · 2 comments
Open

build_waitk_mask does not exist #1

mako2sake opened this issue Oct 20, 2023 · 2 comments

Comments

@mako2sake
Copy link

Thank you so much for your work and open access.
I followed Quick Start in the readme.

While training, the program runs throuh this below line.
But maybe build_waitk_mask function does not exist.

When I commented out this else scope, the train went without stopping.
But I cannot know whether way to fix is correct.

waitk_mask = self.build_waitk_mask(attn_weights, training_lagging_seg)

I searched ictnlp's repo, and I found the similar code in the MoE-Waitk repo.

https://github.com/ictnlp/MoE-Waitk/blob/6f8ca9834c2ab77785ebd93fd569f73c3819340b/fairseq/modules/moe_waitk_multihead_attention.py#L400

I copied this build_waitk_mask function. But i got effor masked_fill only supports boolean masks, but got dtype Float in following procedure.

Please kindly tell me how to fix.

Thank you.

@zhangshaolei1998
Copy link
Collaborator

Sorry, I just saw your issue. This function was deleted by mistake when standardizing the code. I've corrected it in the new commit.
Refer to: waitseg_multihead_attention.py

@mako2sake
Copy link
Author

mako2sake commented Nov 16, 2023

@zhangshaolei1998 Thanks a lot for your reply. I noticed it soon. This problem is solved. Train works well.

But, there are some troble wihr evaluation.
I should comment by another issue?

I comment here some.

  File "~/DiSeg/examples/simultaneous_translation/models/convtransformer_simul_trans.py", line 13, in <module>
    from fairseq.models.speech_to_text import (
ImportError: cannot import name 'convtransformer_espnet_wav2vec_encwav' from 'fairseq.models.speech_to_text' (~/DiSeg/fairseq/models/speech_to_text/__init__.py)

=> should it comment out like this?

from fairseq.models.speech_to_text import (
    ConvTransformerModel,
    convtransformer_espnet,
    convtransformer_espnet_wav2vec,
    # convtransformer_espnet_wav2vec_encwav,
    # ImportError: cannot import name 'convtransformer_espnet_wav2vec_encwav' from 'fairseq.models.speech_to_text' (/home/s2210411/DiSeg/fairseq/models/speech_to_text/__init__.py)
    ConvTransformerModelWac2VecSeg,
    ConvTransformerEncoder,
    ConvTransformerModelWac2Vec,
    # ConvTransformerCIFModel,
    # ConvTransformerModelWac2VecCIF,
    # convtransformer_espnet_cif,
    # convtransformer_espnet_wav2vec_cif,
)
  File "~/DiSeg/fairseq/models/__init__.py", line 121, in register_model_cls
    raise ValueError("Cannot register duplicate model ({})".format(name))
ValueError: Cannot register duplicate model (convtransformer_simul_trans)

=> I don't know how to solve. It seems like this error exists in fairseq repo's issue.

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