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

/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead. #249

Open
hughperkins opened this issue Apr 22, 2020 · 2 comments

Comments

@hughperkins
Copy link

After launching interactive using:

python scripts/pipeline/interactive.py --tokenizer regexp

Enter a question using:

process('what is the capital of france?')

Pages and pages of:

/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torc
h.bool instead.                                                                                        /tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torc
h.bool instead.                                                                                        /tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torc
h.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ re
ceived a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torc
h.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ re
ceived a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torc
h.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ re
ceived a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torc
h.bool instead.
@hughperkins
Copy link
Author

hughperkins commented Apr 22, 2020

(this is using pytorch 1.4 and python 3.6)

@libertatis
Copy link

To solve your issue, just modify the code lines in /drqa/reader/vector.py as follows:
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L93
x1_mask = torch.ByteTensor(len(docs), max_length).fill_(1) -> x1_mask = torch.BoolTensor(len(docs), max_length).fill_(True)
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L100
x1_mask[i, :d.size(0)].fill_(0) -> x1_mask[i, :d.size(0)].fill_(False)
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L107
x2_mask = torch.ByteTensor(len(questions), max_length).fill_(1) -> x2_mask = torch.BoolTensor(len(questions), max_length).fill_(True)
https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/vector.py#L110
x2_mask[i, :q.size(0)].fill_(0) -> x2_mask[i, :d.size(0)].fill_(False)

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