zhang-tao-whu / e2ec

E2EC: An End-to-End Contour-based Method for High-Quality High-Speed Instance Segmentation
Other
214 stars 45 forks source link

when I use the pretrained model to test the cityscape,the accuracy is 0 #23

Closed imzhaoruijie closed 1 year ago

imzhaoruijie commented 1 year ago

I set use_dcn = False,dowload the pretrained model and the dataset to test .The code run successfully, but the result is 0.

zhang-tao-whu commented 1 year ago

I have not provided a pre-trained model without the DCN. If you need to remove the DCN, you will need to train the model from scratch.

imzhaoruijie commented 1 year ago

if I use mmcv instead,can I use your pre-trained model? An error occured: "KeyError: 'dla.dla_up.ida_0.proj_1.conv.conv_offset.weight'

zhang-tao-whu commented 1 year ago

Yes it can. I have tested it before with no problems. Please list your changes so that I can find out what is causing your problem.

imzhaoruijie commented 1 year ago

Thanks for your reply! I tried to train the model on cityscape and it worked well, but some problem occured when I trained on my data. I changed the info.py and changed configs/coco.py ,set model.heads['ct_hm'] = 4, which is the class num of my data. the code run successfully, but the test result is 0. The output information are as follows:

loading annotations into memory... Done (t=0.00s) creating index... index created! WARNING: NO MODEL LOADED !!! ...... eta: 0:00:04 epoch: 4 step: 39 ct_loss: 7.3781 init_py_loss: 133.9993 coarse_py_loss: 68.5959 py_loss_0: 68.5285 py_loss_1: 68.4910 end_set_loss: 0.0000 loss: 73.3108 data: 1.9157 b atch: 4.1253 lr: 0.000100 max_mem: 18490
eta: 0:00:04 epoch: 4 step: 39 ct_loss: 6.9518 init_py_loss: 130.4168 coarse_py_loss: 71.7408 py_loss_0: 71.7066 py_loss_1: 71.6976 end_set_loss: 0.0000 loss: 74.9690 data: 1.7036 b atch: 4.1342 lr: 0.000100 max_mem: 18491
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 54/54 [03:54<00:00, 4.34s/it]
Loading and preparing results...
DONE (t=0.20s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type segm
DONE (t=0.31s).
Accumulating evaluation results...
DONE (t=0.04s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.000

I have visulized my data, and there is no problem with my data.

shuttle999 commented 1 year ago

if I use mmcv instead,can I use your pre-trained model? An error occured: "KeyError: 'dla.dla_up.ida_0.proj_1.conv.conv_offset.weight'

yes, I had the same problem. image image Maybe I need to retrain?

Windaway commented 1 year ago

Since the dcn implement of mmcv and the author is different, you may use below codes to fix the issue.

for key in net_weight.keys():
    key1=key
    key2=key
    if key[-18:]=="conv_offset.weight" :
        key1=key[:-18]+"conv_offset.weight"
        key2=key[:-18]+"conv_offset_mask.weight"
    if key[-16:]=="conv_offset.bias" :
        key1=key[:-16]+"conv_offset.bias"
        key2=key[:-16]+"conv_offset_mask.bias"
    net_weight.update({key1: pretrained_model[key2]})