jbwang1997 / OBBDetection

OBBDetection is an oriented object detection library, which is based on MMdetection.
Apache License 2.0
525 stars 112 forks source link

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed #8

Closed wtl2001 closed 2 years ago

wtl2001 commented 2 years ago

Traceback (most recent call last): File "tools/test.py", line 153, in main() File "tools/test.py", line 147, in main dataset.format_results(outputs, **kwargs) File "/root/wtl2/OBBDetection/mmdet/datasets/obb/dota.py", line 123, in format_results bboxes, scores = dets[:, :-1], dets[:, [-1]] dets的shape是(6,),我怀疑是dets.shape的问题

jbwang1997 commented 2 years ago

dets要是二维向量,shape为(n, 6)。

wtl2001 commented 2 years ago

改了下维度,现在能运行了,谢谢。

chandlerbing65nm commented 2 years ago

I still have this issue even with the latest commit. How to actually solve this? @jbwang1997

jbwang1997 commented 2 years ago

Can you provide more information on this bug? @chandlerbing65nm

chandlerbing65nm commented 2 years ago

Can you provide more information on this bug? @chandlerbing65nm

@jbwang1997 When I run this

python tools/test.py configs/obb/oriented_rcnn/orpn_r50_fpn_1x_dota10.py work_dirs/orpn_r50_fpn_1x_dota10/epoch_12.pth --format-only --options save_dir=work_dirs/orpn_r50_fpn_1x_dota10/task1

An error occurs:

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

This is directed to this code line.

The error only occurs in oriented rcnn.

jbwang1997 commented 2 years ago

Oh, The orpn_r50_fpn_1x_dota10.py only contains RPN and generates proposals. Its output is not the format of prediction boxes. Thus this error occurred.

chandlerbing65nm commented 2 years ago

Oh, The orpn_r50_fpn_1x_dota10.py only contains RPN and generates proposals. Its output is not the format of prediction boxes. Thus this error occurred.

How can I run a test for submission in dota server? @jbwang1997

or do I need to train this one faster_rcnn_orpn_r50_fpn_1x_dota10 and run testing?

jbwang1997 commented 2 years ago

Yes, faster_rcnn_orpn_r50_fpn_1x_dota10.py is the full orietned rcnn config. We also have provided the .pth files in oriented rcnn readme.md. @chandlerbing65nm

chandlerbing65nm commented 2 years ago

Yes, faster_rcnn_orpn_r50_fpn_1x_dota10.py is the full orietned rcnn config. We also have provided the .pth files in oriented rcnn readme.md. @chandlerbing65nm

Question, can I run testing in [3, 512, 512] img scale on your checkpoint files trained in [3, 1024, 1024]?

jbwang1997 commented 2 years ago

Yes, faster_rcnn_orpn_r50_fpn_1x_dota10.py is the full orietned rcnn config. We also have provided the .pth files in oriented rcnn readme.md. @chandlerbing65nm

Question, can I run testing in [3, 512, 512] img scale on your checkpoint files trained in [3, 1024, 1024]?

I think the testing scale should be the same as training. Otherwise, the mAP will drop.

jimuIee commented 7 months ago

你好,请问是怎么改的