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 #17

Closed
hongjianyuan opened this issue Jul 21, 2020 · 0 comments
Closed

runtimeerror #17

hongjianyuan opened this issue Jul 21, 2020 · 0 comments

Comments

@hongjianyuan
Copy link

Traceback (most recent call last):
File "D:/transformer-master/transformer-master/training.py", line 81, in
dataloader_val, epochs=EPOCHS, pbar=pbar, device=device)
File "D:\transformer-master\transformer-master\src\utils\search.py", line 20, in fit
netout = net(x.to(device))
File "C:\anaconda\envs\dl\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer-master\tst\transformer.py", line 129, in forward
encoding = layer(encoding)
File "C:\anaconda\envs\dl\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer-master\tst\encoder.py", line 86, in forward
x = self._selfAttention(query=x, key=x, value=x)
File "C:\anaconda\envs\dl\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer-master\tst\multiHeadAttention.py", line 97, in forward
self._scores = self._scores.masked_fill(attention_mask, float('-inf'))
RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'mask'

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

1 participant