File "train.py", line 432, in
train() # train normally
File "train.py", line 321, in train
dataloader=testloader)
File "D:\Pytorch-yolov3-master\test.py", line 117, in test
output = non_max_suppression(inf_out, conf_thres=conf_thres, iou_thres=iou_thres) # nms
File "D:\Pytorch-yolov3-master\utils\utils.py", line 559, in non_max_suppression
weights = (iou > iou_thres) * scores.view(-1, 1)
RuntimeError: expected device cuda:0 and dtype Float but got device cuda:0 and dtype Bool
I'm using torchvision=0.4.0 torch=1.1.0 pytorch=1.2.0 and cudatoolkit=10.0 on WIN10.It appeared at the end of the first epoch.
I would appreciate it if you could answer me!
@Blddwkb you might need to upgrade your pytorch to 1.4, which is in the requirements section of the readme. If that doesn't work you can always add a .float() to the iou matrix:
weights = (iou > iou_thres).float() * scores.view(-1, 1)
@Blddwkb thx, it works correctly
@alpha027 can you reproduce your issue in a fresh clone of the repo? If so please post your code to reproduce here. Thank you!
The code referenced in https://github.com/ultralytics/yolov3/issues/976#issuecomment-605532460 is in the NMS function in utils/utils.py
This issue is stale because it has been open 30 days with no activity. Remove Stale label or comment or this will be closed in 5 days.
Most helpful comment
@Blddwkb you might need to upgrade your pytorch to 1.4, which is in the requirements section of the readme. If that doesn't work you can always add a .float() to the iou matrix:
weights = (iou > iou_thres).float() * scores.view(-1, 1)