ghimiredhikura/Complex-YOLOv3

RuntimeError: _th_and not supported on CPUType for Bool

anisghaoui opened this issue · 3 comments

I think there is a conflict between the versions of torch/torchvision here.

$ python3 test_detection.py --split=sample --folder=sampledata  
Namespace(class_path='data/classes.names', conf_thres=0.5, folder='sampledata', img_size=608, model_def='config/complex_tiny_yolov3.cfg', nms_thres=0.5, split='sample', weights_path='checkpoints/tiny-yolov3_ckpt_epoch-220.pth')

Load TEST samples from data/KITTI/object/sampledata
Done: total TEST samples 12
Traceback (most recent call last):
  File "test_detection.py", line 124, in <module>
    detections = utils.non_max_suppression_rotated_bbox(detections, opt.conf_thres, opt.nms_thres) 
  File "/home/anis/Complex-YOLOv3/utils/utils.py", line 302, in non_max_suppression_rotated_bbox
    invalid = large_overlap & label_match
RuntimeError: _th_and not supported on CPUType for Bool

I replaced the & operator by np.logical_and() and it worked

This will require a fix

@anisghaoui
Even, I got the same error. Thanks for the solution. Replacing the & operator by np.logical_and() worked!

invalid = np.logical_and(large_overlap,label_match)