解决yolov3运行报警告:UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool
在models.py的class YOLOLayer(nn.Module)里面函数def forward(self, x)以下位置如图:
增加以下语句:
# 增加以下语句,修改bug
obj_mask = obj_mask.bool() # int8 to bool
noobj_mask = noobj_mask.bool() # int8 to bool
参考:https://blog.csdn.net/c2250645962/article/details/104869015