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

[W Indexing.cu:937] Warning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead. (function masked_fill__cuda) #182

Open
bloom1123 opened this issue Oct 21, 2021 · 2 comments

Comments

@bloom1123
Copy link

I meet these warning when i train the network.
[W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (function expandTensors)
[W Resize.cpp:23] Warning: An output with one or more elements was resized since it had shape [1884], which does not match the required output shape [1682].This behavior is deprecated, and in a future PyTorch release outputs will not be resized unless they have zero elements. You can explicitly reuse an out tensor t by resizing it, inplace, to zero elements with t.resize_(0). (function resize_output_check)
[W IndexKernel.cu:456] Warning: masked_scatter_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead. (function masked_scatter__cuda)
[W Indexing.cu:937] Warning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead. (function masked_fill__cuda)

@wyywyyyyw
Copy link

I meet the same question, have you solved it?

@pit-ray
Copy link

pit-ray commented Jan 28, 2022

I met the same warnings.

The solution to the warnings about masked_fill_ and masked_scatter_ is princeton-vl/CornerNet-Lite#111.

The resize_output_check is a warning to prevent incorrect resizing, as described in the FAQ and pytorch#41027. To explicitly allow it, add .resize_(0) before the resize for four corner pools.

max_temp.resize_(0);
at::masked_select_out(max_temp, input_temp, gt_mask);

Both solutions require four files to be modified and recompiled.

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

3 participants