PyTorch-YOLOv3 icon indicating copy to clipboard operation
PyTorch-YOLOv3 copied to clipboard

UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

Open onefish51 opened this issue 6 years ago • 6 comments

when I train yolo v3 on coco, it WARNING that "/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead."

It's so many! How to fix it?

onefish51 avatar Aug 21 '19 12:08 onefish51

image

onefish51 avatar Aug 21 '19 12:08 onefish51

torch1.2.0--->torch1.1.0 torchvision=0.2.0

HG1998-JM avatar Aug 30 '19 02:08 HG1998-JM

I met the same problem. Did you fixed it? @onefish51

runningJ avatar Sep 14 '19 13:09 runningJ

I met the same problem. Did you fixed it? @onefish51

https://github.com/eriklindernoren/PyTorch-YOLOv3/blob/master/models.py#L191 obj_mask=obj_mask.bool() # convert int8 to bool noobj_mask=noobj_mask.bool() #convert int8 to bool

paojianghu avatar Sep 16 '19 03:09 paojianghu

Replace in utils:269

ByteTensor = torch.cuda.ByteTensor if pred_boxes.is_cuda else torch.ByteTensor

With: BoolTensor = torch.cuda.BoolTensor if pred_boxes.is_cuda else torch.BoolTensor

And it usage in lines 278, 279 obj_mask = BoolTensor(nB, nA, nG, nG).fill_(0) noobj_mask = BoolTensor(nB, nA, nG, nG).fill_(1)

iosfixed avatar Oct 21 '19 04:10 iosfixed

@paojianghu You should replace obj_mask=obj_mask.bool() # convert int8 to bool

noobj_mask=noobj_mask.bool() #convert int8 to bool

in utils/utils.py after line 279

ujsyehao avatar Nov 13 '19 06:11 ujsyehao