Skip to content

wrong results during training and testing Overlook module #10

@HuizaiVictorYao

Description

@HuizaiVictorYao

Hi, I was trying to reproduce your work on city->foggy setting, after training source model, everything seems to be ok:

INFO:root:AP for person = 0.2404
INFO:root:AP for rider = 0.3151
INFO:root:AP for car = 0.3397
INFO:root:AP for truck = 0.0629
INFO:root:AP for bus = 0.2125
INFO:root:AP for train = 0.0568
INFO:root:AP for motorcycle = 0.1718
INFO:root:AP for bicycle = 0.2643
INFO:root:Mean AP = 0.2079
INFO:root:tested model: source/faster_rcnn_source_1_20_740.pth
INFO:root:test time: 82.1747s

but as I try to train and test the overlooking module, I got very low losses like:

INFO:root:[epoch  1][iter  170/5930] time cost: 2.384635, lr_faster_rcnn: 1.00e-04
INFO:root:                      fastRCNN loss:0.0010 
INFO:root:                      cons_loss: 0.0000,gw_loss:0.0003,gw_global_loss:0.0001,label_loss:0.0003
INFO:root:                      cons_weight: 0.00,gw_ins_weight:0.10,gw_global_weight:0.10,label_weight:1.00
INFO:root:[epoch  1][iter  180/5930] time cost: 2.385559, lr_faster_rcnn: 1.00e-04
INFO:root:                      fastRCNN loss:0.0009 
INFO:root:                      cons_loss: 0.0000,gw_loss:0.0003,gw_global_loss:0.0001,label_loss:0.0003
INFO:root:                      cons_weight: 0.00,gw_ins_weight:0.10,gw_global_weight:0.10,label_weight:1.00
INFO:root:im_detect: 101/500, detect time:0.036s, nms time:0.003s   
INFO:root:[epoch  1][iter  190/5930] time cost: 2.432270, lr_faster_rcnn: 1.00e-04
INFO:root:                      fastRCNN loss:0.0009 
INFO:root:                      cons_loss: 0.0000,gw_loss:0.0003,gw_global_loss:0.0002,label_loss:0.0004
INFO:root:                      cons_weight: 0.00,gw_ins_weight:0.10,gw_global_weight:0.10,label_weight:1.00
INFO:root:[epoch  1][iter  200/5930] time cost: 2.446995, lr_faster_rcnn: 1.00e-04
INFO:root:                      fastRCNN loss:0.0009 
INFO:root:                      cons_loss: 0.0000,gw_loss:0.0004,gw_global_loss:0.0001,label_loss:0.0003
INFO:root:                      cons_weight: 0.00,gw_ins_weight:0.10,gw_global_weight:0.10,label_weight:1.00

after all iters, the results was weird:

INFO:root:VOC07 metric? Yes
INFO:root:AP for person = 0.0004
INFO:root:AP for rider = 0.0000
INFO:root:AP for car = 0.0003
INFO:root:AP for truck = 0.0000
INFO:root:AP for bus = 0.0000
INFO:root:AP for train = 0.0000
INFO:root:AP for motorcycle = 0.0000
INFO:root:AP for bicycle = 0.0001
INFO:root:Mean AP = 0.0001

Do you have similar experience about this or have you got some methods to fix this?

I only have 3090 recourses so I changed pytorch and cuda together with cuda>=11:

>>> torch.__version__
'1.8.0+cu111'

my python version is 3.9.15

and due to the error below:

ERROR:root:Error(s) in loading state_dict for vgg16:
        Missing key(s) in state_dict: "RCNN_base1.0.weight", "RCNN_base1.0.bias", "RCNN_base2.0.weight", "RCNN_base2.0.bias", "RCNN_base2.3.weight", "RCNN_base2.3.bias", "RCNN_base3.0.weight", "RCNN_base3.0.bias", "RCNN_base3.3.weight", "RCNN_base3.3.bias", "RCNN_base4.0.weight", "RCNN_base4.0.bias", "RCNN_base4.2.weight", "RCNN_base4.2.bias", "RCNN_base4.5.weight", "RCNN_base4.5.bias", "RCNN_base4.7.weight", "RCNN_base4.7.bias", "RCNN_base4.9.weight", "RCNN_base4.9.bias", "RCNN_base4.12.weight", "RCNN_base4.12.bias", "RCNN_base4.14.weight", "RCNN_base4.14.bias", "RCNN_base4.16.weight", "RCNN_base4.16.bias". 
        Unexpected key(s) in state_dict: "RCNN_base.0.weight", "RCNN_base.0.bias", "RCNN_base.2.weight", "RCNN_base.2.bias", "RCNN_base.5.weight", "RCNN_base.5.bias", "RCNN_base.7.weight", "RCNN_base.7.bias", "RCNN_base.10.weight", "RCNN_base.10.bias", "RCNN_base.12.weight", "RCNN_base.12.bias", "RCNN_base.14.weight", "RCNN_base.14.bias", "RCNN_base.17.weight", "RCNN_base.17.bias", "RCNN_base.19.weight", "RCNN_base.19.bias", "RCNN_base.21.weight", "RCNN_base.21.bias", "RCNN_base.24.weight", "RCNN_base.24.bias", "RCNN_base.26.weight", "RCNN_base.26.bias", "RCNN_base.28.weight", "RCNN_base.28.bias". 

I modified line 20 of Overlook/utils.py like below:

# fasterRCNN.load_state_dict(state_dict)
fasterRCNN.load_state_dict(state_dict,False)

thanks for your reply in advance :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions