nanodet-opncv-dnn-cpp-python icon indicating copy to clipboard operation
nanodet-opncv-dnn-cpp-python copied to clipboard

numpy.AxisError: axis 1 is out of bounds for array of dimension 1

Open tim4anker opened this issue 4 years ago • 1 comments

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

tim4anker avatar Feb 23 '21 03:02 tim4anker

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这个维度

hpc203 avatar May 14 '21 10:05 hpc203