ddrnet: 非单元向量维度 3 上的张量 a (182) 的大小必须与张量 b (181) 的大小匹配

作者: yazansayed创建于 2023年9月22日更新于 2026年4月25日
标签bugBacklog

crop_size = (832, 832) scale = (2048, 832) test_scale = (1024, 1024) data_root = 'dataxseg' dataset_type = 'TextDet1Dataset' save_interval = 500 max_iters = 6000 val_interval= 500 load_from = None batch_size=16 startlr = 0.0005 min_lr=1e-06 num_workers=2 class_weight = [0.8, 1.1] checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/ddrnet/pretrain/ddrnet23s-in1kpre_3rdparty-1ccac5b1.pth' # noqa data_preprocessor = dict( type='SegDataPreProcessor', size=crop_size, mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], bgr_to_rgb=True, pad_val=0, seg_pad_val=255) norm_cfg = dict( type='SyncBN', requires_grad=True) model = dict( type='EncoderDecoder', data_preprocessor=data_preprocessor, backbone=dict( type='DDRNet', in_channels=3, channels=32, ppm_channels=128, norm_cfg=norm_cfg, align_corners=False, init_cfg=dict( type='Pretrained', checkpoint=checkpoint) ), decode_head=dict( type='DDRHead', in_channels=32 * 4, channels=64, dropout_ratio=0., num_classes=2, align_corners=False, norm_cfg=norm_cfg, loss_decode=[ dict( type='OhemCrossEntropy', thres=0.9, min_kept=131072, class_weight=class_weight, loss_weight=1.0 ), dict( type='OhemCrossEntropy', thres=0.9, min_kept=131072, class_weight=class_weight, loss_weight=0.4 ) ] ), # model training and testing settings train_cfg=dict(), test_cfg=dict( mode='whole' ) ) train_dataloader = dict( batch_size=batch_size, num_workers=num_workers ) # optimizer # optimizer = dict( type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005 ) optimizer = dict( lr=startlr, type='AdamW', weight_decay=0.0005 ) optim_wrapper = dict( type='OptimWrapper', optimizer=optimizer, clip_grad=None ) # learning policy param_scheduler = [ dict( type='PolyLR', eta_min=min_lr, power=0.9, begin=0, end=max_iters, by_epoch=False ) ] # training schedule for 120k train_cfg = dict( type='IterBasedTrainLoop', max_iters=max_iters, val_interval=val_interval ) …

内容来源: open-mmlab/mmsegmentation