Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WYC-321 opened this issue Apr 7, 2023 · 1 comment

Comments

@WYC-321
Copy link

WYC-321 commented Apr 7, 2023

您好,非常感谢您的开源,这个工作非常好。
我尝试使用配置: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
Copy link
Author

WYC-321 commented Apr 24, 2023

@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不是你联合训练时使用的预训练模型?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant