nanodet-opncv-dnn-cpp-python
nanodet-opncv-dnn-cpp-python copied to clipboard
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
line 103, in get_bboxes_single max_scores = cls_score.max(axis=1) numpy.AxisError: axis 1 is out of bounds for array of dimension 1
line 103, in get_bboxes_single max_scores = cls_score.max(axis=1) numpy.AxisError: axis 1 is out of bounds for array of dimension 1
这个bug,我已经修复了。在第93和94行,现在改为 cls_score = cls_score.squeeze(axis=0) bbox_pred = bbox_pred.squeeze(axis=0) 之前没有加axis=0这个参数,如果类别只有一个,不加axis=0这个参数,就会出现上面的错误,加axis=0是为了消除batchsize=1这个维度