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

module 'torch.nn' has no attribute 'MultiheadAttention' #13

Open
chenQ1114 opened this issue Jun 18, 2019 · 1 comment
Open

module 'torch.nn' has no attribute 'MultiheadAttention' #13

chenQ1114 opened this issue Jun 18, 2019 · 1 comment

Comments

@chenQ1114
Copy link

Hi
In the file of modules/attention.py, the class MultiHeadAttention(nn.MultiheadAttention) is reported an error:

class MultiHeadAttention(nn.MultiheadAttention):
AttributeError: module 'torch.nn' has no attribute 'MultiheadAttention'

I use the pytorch=0.4.1. Is there any version of torch that containing the nn.MultiheadAttention?

@frostinassiky
Copy link

Upgrade to PyTorch 1.3 can solve this problem.

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