megvii-model / CrowdDetection

Apache License 2.0
273 stars 44 forks source link

Errors when runing on myself dataset #1

Closed UpCoder closed 4 years ago

UpCoder commented 4 years ago

Environment

Hi, I run this code based on the crowd person dataset, It seem everything is ok.

11 23:56:11 e0, 112/3750, lr:0.002123, total_loss:0.870193, rpn_cls:0.212023, rpn_loc:0.182936, rcnn_emd:0.475234
11 23:56:18 e0, 113/3750, lr:0.002127, total_loss:0.817391, rpn_cls:0.129117, rpn_loc:0.066281, rcnn_emd:0.621992
11 23:56:19 e0, 114/3750, lr:0.002132, total_loss:1.136824, rpn_cls:0.205079, rpn_loc:0.195120, rcnn_emd:0.736625

But, when I try to run this code based on myself dataset, it always occur the error as follows:

 File "/root/ld/PycharmProjects/CrowdDetection/model/emd_simple/train.py", line 60, in train_one_epoch
    losses = propagate()
megengine._internal.exc.MegBrainError: MegBrain core throws exception: mgb::MegDNNError
bad input shape for polyadic operator: {2034,12}, {2034,4}
| Associated operator: id=130407 name=SUB(reshape[130071],reshape[130401])[130407] type=mgb::opr::Elemwise
|   input variables: 
|     0: {id:130072, shape:{2034,12}, Float32, owner:reshape(concat[130063])[130071]{Reshape}, name:reshape(concat[130063])[130071], slot:0, gpu0:0, d, 8, 8}
|     1: {id:130402, shape:{2034,4}, Float32, owner:reshape(indexing_multi_axis_vec[130398])[130401]{Reshape}, name:reshape(indexing_multi_axis_vec[130398])[130401], slot:0, gpu0:0, d, 8, 8}
|   output variables: 
|     0: {id:130408, shape:{}, Float32, owner:SUB(reshape[130071],reshape[130401])[130407]{Elemwise}, name:SUB(reshape[130071],reshape[130401])[130407], slot:0, gpu0:0, d, 8, 8}

Do you have any suggestion about that? Thanks

xg-chu commented 4 years ago

It seems that you are using a dataset with multiple classes to train this model. This code is designed for datasets with only one class, such as crowdhuman. I will check and fix it.

UpCoder commented 4 years ago

yes, if I use binray class, it will work. I also found that if there is a image without any gtbbox, it also will occur an error. Looking forward to your further work.

xg-chu commented 4 years ago

You can train multiple classes in emd_simple and fpn_baseline now. But emd_refine can still only be trianed with binary classes. If there is images with no ground truth or only one ground truth box, we recommend that you skip these images in dataset.py.

UpCoder commented 4 years ago

Thank you, It works now. And it improve the performance. The mAP of fatser rcnn in 0.56, the mAP of your method is about 0.57