Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tim4anker opened this issue Feb 23, 2021 · 1 comment
Open

Comments

@tim4anker
Copy link

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

@hpc203 hpc203 closed this as completed May 14, 2021
@hpc203
Copy link
Owner

hpc203 commented May 14, 2021

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 hpc203 reopened this May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants