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

expected dtype Byte but got dtype Bool #19

Open
mengyunyun0824 opened this issue May 3, 2022 · 1 comment
Open

expected dtype Byte but got dtype Bool #19

mengyunyun0824 opened this issue May 3, 2022 · 1 comment

Comments

@mengyunyun0824
Copy link

Hi!
An error occurs when I run MAML.py. Can you give me some advice? Thanks a lot!

Issue summary
Traceback (most recent call last):
File "MAML.py", line 149, in
v_loss, v_ppl = do_evaluation(meta_net, val_iter)
File "MAML.py", line 99, in do_evaluation
loss, ppl, _ = model.train_one_batch(batch, train=False)
File "C:\Users\lenovo\Desktop\PAML\PAML\model\transformer.py", line 329, in train_one_batch
pre_logit, attn_dist = self.decoder(self.embedding(dec_batch_shift),encoder_outputs, (mask_src,mask_trg))
File "C:\Users\lenovo\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "C:\Users\lenovo\Desktop\PAML\PAML\model\transformer.py", line 177, in forward
dec_mask = torch.gt(mask_trg + self.mask[:, :mask_trg.size(-1), :mask_trg.size(-1)], 0)

RuntimeError: expected device cuda:0 and dtype Byte but got device cuda:0 and dtype Bool

@mengyunyun0824
Copy link
Author

Is it because I am using torch==1.2.0 ?

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