cuiziteng / Illumination-Adaptive-Transformer

[BMVC 2022] You Only Need 90K Parameters to Adapt Light: A Light Weight Transformer for Image Enhancement and Exposure Correction. SOTA for low light enhancement, 0.004 seconds try this for pre-processing.
Apache License 2.0
441 stars 43 forks source link

当我尝试联合训练IAT和DeeplabV3+时,IAT的预训练参数似乎没有加载 #40

Open WYC-321 opened 1 year ago

WYC-321 commented 1 year ago

您好,非常感谢您的开源,这个工作非常好。 我尝试使用配置:configs/deeplabv3plus/deeplabv3plus_r50-d8_1024x1024_80k_ACDC_night_with_IAT_LOL.py 进行联合训练,并在此配置文件中设置: pre_backbone=dict( type='Dynamic_SID', in_dim=3, with_global=True, init_cfg=dict(type='Pretrained', checkpoint='pre_train_models/LOL_copyFromEnhance.pth') 同时,在tools/train.py中设置: '--load-from',default='../pre_train_models/deeplabv3plus_r50-d8_512x1024_80k_cityscapes_20200606_114049-f9fb496d.pth', help='the checkpoint file to load weights from')。

虽然代码能成功运行,但是似乎只加载了deeplabv3plus的预训练模型,IAT的预训练模型并没有加载进去。 我的MMCV版本为1.4.0 MMSeg的版本为0.20.2,您能能看下我的设置是否有问题,或者能确定下您那边是否成功加载预训练参数了吗?事实上,pre_backbone的checkpoint路径随便写,运行代码也没有报错,如果能加载预训练参数的话遇到错误路径应该会报错的吧。

WYC-321 commented 1 year ago

@cuiziteng 你好,我确定当前的代码联合训练IAT和DeeplabV3+用于分割任务时,没有载入预训练的IAT模型参数,并且发现了如何将其修改为能正确导入参数。 具体地,在IAT_mmseg/mmseg/models/backbones/model.py 中: 将class Dynamic_SID(nn.Module) 改为class Dynamic_SID(BaseModule) 将super(Dynamic_SID, self).init() 改为super(Dynamic_SID, self).init(init_cfg) 修改这两处后模型能正常载入预训练的IAT参数。但是同时,我发现如果将IAT_enhance中提供的模型best_Epoch_lol_v1.pth作为IAT预训练模型载入,进行联合训练,效果很差,损失甚至不收敛,最后的分割结果中多个类的IoU指标为0. 造成这个问题的原因是否是因为best_Epoch_lol_v1.pth不是你联合训练时使用的预训练模型?