_base_ = [
    '../_base_/models/dmnet_r50-d8.py',
    '../_base_/datasets/my_dataset.py', #换成自己定义的数据集
    '../_base_/default_runtime.py',
    '../_base_/schedules/schedule_160k.py'
]
crop_size = (512, 512)
data_preprocessor = dict(size=crop_size)
model = dict(
    pretrained='open-mmlab://resnet50_v1c',
    backbone=dict(depth=50),
    data_preprocessor=data_preprocessor,
    decode_head=dict(
        num_classes=20, # TODO 设置不同分类种类
        loss_decode=dict(type='DiceLoss', use_sigmoid=False, loss_weight=1.0), # TODO 设置不同分类种类，它根据预测结果和真实标签的重叠区域来度量相似性
        # align_corners=True,
        align_corners=False, # 在不用slide时
    ),
    auxiliary_head=dict(
        num_classes=20, # TODO 设置不同分类种类
        loss_decode=dict(type='DiceLoss', use_sigmoid=False, loss_weight=1.0), # TODO 设置不同分类种类，它根据预测结果和真实标签的重叠区域来度量相似性
        # align_corners=True,
        align_corners=False, # 在不用slide时
    ),
    # test_cfg=dict(mode='slide', crop_size=(512, 512), stride=(512, 512))
)

# optimizer（优化器设计）TODO
optim_wrapper = dict(
    type='OptimWrapper',
    _delete_=True,
    optimizer=dict(type='AdamW', lr=0.0001, weight_decay=0.0005),
    clip_grad=dict(max_norm=1, norm_type=2))

param_scheduler = [
    dict(
        type='LinearLR', start_factor=1e-6, by_epoch=False, begin=0, end=1500),
    dict(
        type='PolyLR',
        power=1.0,
        begin=1500,
        end=160000,
        eta_min=0.0,
        by_epoch=False,
    )
]