CornerNet icon indicating copy to clipboard operation
CornerNet copied to clipboard

[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)

Open bloom1123 opened this issue 3 years ago • 2 comments

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)

bloom1123 avatar Oct 21 '21 00:10 bloom1123

I meet the same question, have you solved it?

wyywyyyyw avatar Dec 10 '21 03:12 wyywyyyyw

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.

pit-ray avatar Jan 28 '22 09:01 pit-ray