From b08182280981238db3204b06ed14246adb053a3a Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Thu, 8 Apr 2021 12:05:38 +0800 Subject: [PATCH 01/11] Add support for Pascal Context 59 classes (#459) * Create PascalContextDataset59 class in mmseg/datasets/pascal_context.py; * Set reduce_zero_label=True for train_pipeline and PascalContextDataset59; * Add some configs for Pascal-Context 59 classes training and testing; --- configs/_base_/datasets/pascal_context_59.py | 60 +++++++++++++++++++ .../schedules/schedule_160k_epochwise.py | 9 +++ .../schedules/schedule_20k_epochwise.py | 9 +++ .../schedules/schedule_40k_epochwise.py | 9 +++ .../schedules/schedule_80k_epochwisse.py | 9 +++ ...cn_r50-d8_480x480_40k_pascal_context_59.py | 9 +++ .../fcn_hr18_480x480_40k_pascal_context_59.py | 8 +++ .../fcn_hr18_480x480_80k_pascal_context_59.py | 8 +++ ...fcn_hr18s_480x480_40k_pascal_context_59.py | 9 +++ ...fcn_hr18s_480x480_80k_pascal_context_59.py | 9 +++ .../fcn_hr48_480x480_40k_pascal_context_59.py | 10 ++++ .../fcn_hr48_480x480_80k_pascal_context_59.py | 10 ++++ demo/MMSegmentation_Tutorial.ipynb | 7 +++ mmseg/datasets/__init__.py | 22 +++++-- mmseg/datasets/pascal_context.py | 49 +++++++++++++++ 15 files changed, 232 insertions(+), 5 deletions(-) create mode 100644 configs/_base_/datasets/pascal_context_59.py create mode 100644 configs/_base_/schedules/schedule_160k_epochwise.py create mode 100644 configs/_base_/schedules/schedule_20k_epochwise.py create mode 100644 configs/_base_/schedules/schedule_40k_epochwise.py create mode 100644 configs/_base_/schedules/schedule_80k_epochwisse.py create mode 100644 configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/hrnet/fcn_hr18_480x480_40k_pascal_context_59.py create mode 100644 configs/hrnet/fcn_hr18_480x480_80k_pascal_context_59.py create mode 100644 configs/hrnet/fcn_hr18s_480x480_40k_pascal_context_59.py create mode 100644 configs/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py create mode 100644 configs/hrnet/fcn_hr48_480x480_40k_pascal_context_59.py create mode 100644 configs/hrnet/fcn_hr48_480x480_80k_pascal_context_59.py diff --git a/configs/_base_/datasets/pascal_context_59.py b/configs/_base_/datasets/pascal_context_59.py new file mode 100644 index 0000000000..37585abab8 --- /dev/null +++ b/configs/_base_/datasets/pascal_context_59.py @@ -0,0 +1,60 @@ +# dataset settings +dataset_type = 'PascalContextDataset59' +data_root = 'data/VOCdevkit/VOC2010/' +img_norm_cfg = dict( + mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) + +img_scale = (520, 520) +crop_size = (480, 480) + +train_pipeline = [ + dict(type='LoadImageFromFile'), + dict(type='LoadAnnotations', reduce_zero_label=True), + dict(type='Resize', img_scale=img_scale, ratio_range=(0.5, 2.0)), + dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), + dict(type='RandomFlip', prob=0.5), + dict(type='PhotoMetricDistortion'), + dict(type='Normalize', **img_norm_cfg), + dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255), + dict(type='DefaultFormatBundle'), + dict(type='Collect', keys=['img', 'gt_semantic_seg']), +] +test_pipeline = [ + dict(type='LoadImageFromFile'), + dict( + type='MultiScaleFlipAug', + img_scale=img_scale, + # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], + flip=False, + transforms=[ + dict(type='Resize', keep_ratio=True), + dict(type='RandomFlip'), + dict(type='Normalize', **img_norm_cfg), + dict(type='ImageToTensor', keys=['img']), + dict(type='Collect', keys=['img']), + ]) +] +data = dict( + samples_per_gpu=4, + workers_per_gpu=4, + train=dict( + type=dataset_type, + data_root=data_root, + img_dir='JPEGImages', + ann_dir='SegmentationClassContext', + split='ImageSets/SegmentationContext/train.txt', + pipeline=train_pipeline), + val=dict( + type=dataset_type, + data_root=data_root, + img_dir='JPEGImages', + ann_dir='SegmentationClassContext', + split='ImageSets/SegmentationContext/val.txt', + pipeline=test_pipeline), + test=dict( + type=dataset_type, + data_root=data_root, + img_dir='JPEGImages', + ann_dir='SegmentationClassContext', + split='ImageSets/SegmentationContext/val.txt', + pipeline=test_pipeline)) diff --git a/configs/_base_/schedules/schedule_160k_epochwise.py b/configs/_base_/schedules/schedule_160k_epochwise.py new file mode 100644 index 0000000000..1da307e680 --- /dev/null +++ b/configs/_base_/schedules/schedule_160k_epochwise.py @@ -0,0 +1,9 @@ +# optimizer +optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) +optimizer_config = dict() +# learning policy +lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) +# runtime settings +runner = dict(type='IterBasedRunner', max_iters=160000) +checkpoint_config = dict(by_epoch=True, interval=16000) +evaluation = dict(interval=16000, metric='mIoU') diff --git a/configs/_base_/schedules/schedule_20k_epochwise.py b/configs/_base_/schedules/schedule_20k_epochwise.py new file mode 100644 index 0000000000..295098cfdb --- /dev/null +++ b/configs/_base_/schedules/schedule_20k_epochwise.py @@ -0,0 +1,9 @@ +# optimizer +optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) +optimizer_config = dict() +# learning policy +lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=True) +# runtime settings +runner = dict(type='IterBasedRunner', max_iters=20000) +checkpoint_config = dict(by_epoch=True, interval=2000) +evaluation = dict(interval=2000, metric='mIoU') diff --git a/configs/_base_/schedules/schedule_40k_epochwise.py b/configs/_base_/schedules/schedule_40k_epochwise.py new file mode 100644 index 0000000000..549d20161c --- /dev/null +++ b/configs/_base_/schedules/schedule_40k_epochwise.py @@ -0,0 +1,9 @@ +# optimizer +optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) +optimizer_config = dict() +# learning policy +lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=True) +# runtime settings +runner = dict(type='IterBasedRunner', max_iters=40000) +checkpoint_config = dict(by_epoch=True, interval=4000) +evaluation = dict(interval=4000, metric='mIoU') diff --git a/configs/_base_/schedules/schedule_80k_epochwisse.py b/configs/_base_/schedules/schedule_80k_epochwisse.py new file mode 100644 index 0000000000..371dba1e7d --- /dev/null +++ b/configs/_base_/schedules/schedule_80k_epochwisse.py @@ -0,0 +1,9 @@ +# optimizer +optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) +optimizer_config = dict() +# learning policy +lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) +# runtime settings +runner = dict(type='IterBasedRunner', max_iters=80000) +checkpoint_config = dict(by_epoch=True, interval=8000) +evaluation = dict(interval=8000, metric='mIoU') diff --git a/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py b/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..aac0f7600c --- /dev/null +++ b/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,9 @@ +_base_ = [ + '../_base_/models/fcn_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_40k.py' +] +model = dict( + decode_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/hrnet/fcn_hr18_480x480_40k_pascal_context_59.py b/configs/hrnet/fcn_hr18_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..d2eecf0163 --- /dev/null +++ b/configs/hrnet/fcn_hr18_480x480_40k_pascal_context_59.py @@ -0,0 +1,8 @@ +_base_ = [ + '../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context_59.py', + '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' +] +model = dict( + decode_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/hrnet/fcn_hr18_480x480_80k_pascal_context_59.py b/configs/hrnet/fcn_hr18_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..9cbf4100d1 --- /dev/null +++ b/configs/hrnet/fcn_hr18_480x480_80k_pascal_context_59.py @@ -0,0 +1,8 @@ +_base_ = [ + '../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context_59.py', + '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' +] +model = dict( + decode_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/hrnet/fcn_hr18s_480x480_40k_pascal_context_59.py b/configs/hrnet/fcn_hr18s_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..0412c64f31 --- /dev/null +++ b/configs/hrnet/fcn_hr18s_480x480_40k_pascal_context_59.py @@ -0,0 +1,9 @@ +_base_ = './fcn_hr18_480x480_40k_pascal_context_59.py' +model = dict( + pretrained='open-mmlab://msra/hrnetv2_w18_small', + backbone=dict( + extra=dict( + stage1=dict(num_blocks=(2, )), + stage2=dict(num_blocks=(2, 2)), + stage3=dict(num_modules=3, num_blocks=(2, 2, 2)), + stage4=dict(num_modules=2, num_blocks=(2, 2, 2, 2))))) diff --git a/configs/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py b/configs/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..babd88db4e --- /dev/null +++ b/configs/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py @@ -0,0 +1,9 @@ +_base_ = './fcn_hr18_480x480_80k_pascal_context_59.py' +model = dict( + pretrained='open-mmlab://msra/hrnetv2_w18_small', + backbone=dict( + extra=dict( + stage1=dict(num_blocks=(2, )), + stage2=dict(num_blocks=(2, 2)), + stage3=dict(num_modules=3, num_blocks=(2, 2, 2)), + stage4=dict(num_modules=2, num_blocks=(2, 2, 2, 2))))) diff --git a/configs/hrnet/fcn_hr48_480x480_40k_pascal_context_59.py b/configs/hrnet/fcn_hr48_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..655b460467 --- /dev/null +++ b/configs/hrnet/fcn_hr48_480x480_40k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = './fcn_hr18_480x480_40k_pascal_context_59.py' +model = dict( + pretrained='open-mmlab://msra/hrnetv2_w48', + backbone=dict( + extra=dict( + stage2=dict(num_channels=(48, 96)), + stage3=dict(num_channels=(48, 96, 192)), + stage4=dict(num_channels=(48, 96, 192, 384)))), + decode_head=dict( + in_channels=[48, 96, 192, 384], channels=sum([48, 96, 192, 384]))) diff --git a/configs/hrnet/fcn_hr48_480x480_80k_pascal_context_59.py b/configs/hrnet/fcn_hr48_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..012ad0a7d6 --- /dev/null +++ b/configs/hrnet/fcn_hr48_480x480_80k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = './fcn_hr18_480x480_80k_pascal_context_59.py' +model = dict( + pretrained='open-mmlab://msra/hrnetv2_w48', + backbone=dict( + extra=dict( + stage2=dict(num_channels=(48, 96)), + stage3=dict(num_channels=(48, 96, 192)), + stage4=dict(num_channels=(48, 96, 192, 384)))), + decode_head=dict( + in_channels=[48, 96, 192, 384], channels=sum([48, 96, 192, 384]))) diff --git a/demo/MMSegmentation_Tutorial.ipynb b/demo/MMSegmentation_Tutorial.ipynb index 127ad4e6a7..081a66f1f1 100644 --- a/demo/MMSegmentation_Tutorial.ipynb +++ b/demo/MMSegmentation_Tutorial.ipynb @@ -1411,6 +1411,13 @@ } } ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ] } diff --git a/mmseg/datasets/__init__.py b/mmseg/datasets/__init__.py index 4f248dc16b..3612a6e86e 100644 --- a/mmseg/datasets/__init__.py +++ b/mmseg/datasets/__init__.py @@ -6,13 +6,25 @@ from .dataset_wrappers import ConcatDataset, RepeatDataset from .drive import DRIVEDataset from .hrf import HRFDataset -from .pascal_context import PascalContextDataset +from .pascal_context import PascalContextDataset, PascalContextDataset59 from .stare import STAREDataset from .voc import PascalVOCDataset __all__ = [ - 'CustomDataset', 'build_dataloader', 'ConcatDataset', 'RepeatDataset', - 'DATASETS', 'build_dataset', 'PIPELINES', 'CityscapesDataset', - 'PascalVOCDataset', 'ADE20KDataset', 'PascalContextDataset', - 'ChaseDB1Dataset', 'DRIVEDataset', 'HRFDataset', 'STAREDataset' + 'CustomDataset', + 'build_dataloader', + 'ConcatDataset', + 'RepeatDataset', + 'DATASETS', + 'build_dataset', + 'PIPELINES', + 'CityscapesDataset', + 'PascalVOCDataset', + 'ADE20KDataset', + 'PascalContextDataset', + 'PascalContextDataset59', + 'ChaseDB1Dataset', + 'DRIVEDataset', + 'HRFDataset', + 'STAREDataset', ] diff --git a/mmseg/datasets/pascal_context.py b/mmseg/datasets/pascal_context.py index ab42877f1e..d99252b498 100644 --- a/mmseg/datasets/pascal_context.py +++ b/mmseg/datasets/pascal_context.py @@ -52,3 +52,52 @@ def __init__(self, split, **kwargs): reduce_zero_label=False, **kwargs) assert osp.exists(self.img_dir) and self.split is not None + + +@DATASETS.register_module() +class PascalContextDataset59(CustomDataset): + """PascalContext dataset. + + In segmentation map annotation for PascalContext, 0 stands for background, + which is included in 60 categories. ``reduce_zero_label`` is fixed to + False. The ``img_suffix`` is fixed to '.jpg' and ``seg_map_suffix`` is + fixed to '.png'. + + Args: + split (str): Split txt file for PascalContext. + """ + + CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', + 'cat', 'chair', 'cow', 'table', 'dog', 'horse', 'motorbike', + 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor', + 'bag', 'bed', 'bench', 'book', 'building', 'cabinet', 'ceiling', + 'cloth', 'computer', 'cup', 'door', 'fence', 'floor', 'flower', + 'food', 'grass', 'ground', 'keyboard', 'light', 'mountain', + 'mouse', 'curtain', 'platform', 'sign', 'plate', 'road', 'rock', + 'shelves', 'sidewalk', 'sky', 'snow', 'bedclothes', 'track', + 'tree', 'truck', 'wall', 'water', 'window', 'wood') + + PALETTE = [[180, 120, 120], [6, 230, 230], [80, 50, 50], [4, 200, 3], + [120, 120, 80], [140, 140, 140], [204, 5, 255], [230, 230, 230], + [4, 250, 7], [224, 5, 255], [235, 255, 7], [150, 5, 61], + [120, 120, 70], [8, 255, 51], [255, 6, 82], [143, 255, 140], + [204, 255, 4], [255, 51, 7], [204, 70, 3], [0, 102, 200], + [61, 230, 250], [255, 6, 51], [11, 102, 255], [255, 7, 71], + [255, 9, 224], [9, 7, 230], [220, 220, 220], [255, 9, 92], + [112, 9, 255], [8, 255, 214], [7, 255, 224], [255, 184, 6], + [10, 255, 71], [255, 41, 10], [7, 255, 255], [224, 255, 8], + [102, 8, 255], [255, 61, 6], [255, 194, 7], [255, 122, 8], + [0, 255, 20], [255, 8, 41], [255, 5, 153], [6, 51, 255], + [235, 12, 255], [160, 150, 20], [0, 163, 255], [140, 140, 140], + [250, 10, 15], [20, 255, 0], [31, 255, 0], [255, 31, 0], + [255, 224, 0], [153, 255, 0], [0, 0, 255], [255, 71, 0], + [0, 235, 255], [0, 173, 255], [31, 0, 255]] + + def __init__(self, split, **kwargs): + super(PascalContextDataset59, self).__init__( + img_suffix='.jpg', + seg_map_suffix='.png', + split=split, + reduce_zero_label=True, + **kwargs) + assert osp.exists(self.img_dir) and self.split is not None From 8371ba50bbe412464c99557e6773fda3c547d1a4 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Thu, 8 Apr 2021 16:08:55 +0800 Subject: [PATCH 02/11] Try to solve the problem about "fence(IoU)=nan grass(IoU)=0"; --- mmseg/datasets/pascal_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmseg/datasets/pascal_context.py b/mmseg/datasets/pascal_context.py index d99252b498..177446d895 100644 --- a/mmseg/datasets/pascal_context.py +++ b/mmseg/datasets/pascal_context.py @@ -98,6 +98,6 @@ def __init__(self, split, **kwargs): img_suffix='.jpg', seg_map_suffix='.png', split=split, - reduce_zero_label=True, + reduce_zero_label=False, **kwargs) assert osp.exists(self.img_dir) and self.split is not None From f5ab1f92c96e310e7d78719a11461b5b640a4c11 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Thu, 8 Apr 2021 20:13:01 +0800 Subject: [PATCH 03/11] Continue(1): Try to solve the problem about "fence(IoU)=nan grass(IoU)=0"; --- mmseg/datasets/pascal_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmseg/datasets/pascal_context.py b/mmseg/datasets/pascal_context.py index 177446d895..d99252b498 100644 --- a/mmseg/datasets/pascal_context.py +++ b/mmseg/datasets/pascal_context.py @@ -98,6 +98,6 @@ def __init__(self, split, **kwargs): img_suffix='.jpg', seg_map_suffix='.png', split=split, - reduce_zero_label=False, + reduce_zero_label=True, **kwargs) assert osp.exists(self.img_dir) and self.split is not None From 3379dd3cbb0091d89dbbc28a05d006a9e1ea01b6 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Fri, 9 Apr 2021 11:15:03 +0800 Subject: [PATCH 04/11] ignore files and folders named tempxxx; --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 9b7cffbc88..081de14b45 100644 --- a/.gitignore +++ b/.gitignore @@ -113,5 +113,10 @@ data *.log.json work_dirs/ +# temp file or folder +/temp*/ +/temp*.py +/temp*.txt + # Pytorch *.pth From c2be19a1c6048d4fb5c757f7d5ccc19d7304de82 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Fri, 9 Apr 2021 17:35:51 +0800 Subject: [PATCH 05/11] Continue(2): Try to solve the problem about "fence(IoU)=nan grass(IoU)=0"; * Modify the calculation of IoU; --- mmseg/core/evaluation/metrics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mmseg/core/evaluation/metrics.py b/mmseg/core/evaluation/metrics.py index 769e9b3ab4..fb07fc44d1 100644 --- a/mmseg/core/evaluation/metrics.py +++ b/mmseg/core/evaluation/metrics.py @@ -57,11 +57,11 @@ def intersect_and_union(pred_label, intersect = pred_label[pred_label == label] area_intersect = torch.histc( - intersect.float(), bins=(num_classes), min=0, max=num_classes) + intersect.float(), bins=num_classes, min=0, max=num_classes - 1) area_pred_label = torch.histc( - pred_label.float(), bins=(num_classes), min=0, max=num_classes) + pred_label.float(), bins=num_classes, min=0, max=num_classes - 1) area_label = torch.histc( - label.float(), bins=(num_classes), min=0, max=num_classes) + label.float(), bins=num_classes, min=0, max=num_classes - 1) area_union = area_pred_label + area_label - area_intersect return area_intersect, area_union, area_pred_label, area_label From 42ea672c17d1fcebc345e298f88bed68cc56b93f Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Fri, 9 Apr 2021 19:55:43 +0800 Subject: [PATCH 06/11] Modify the CLASSES order of PascalContextDataset; --- .gitignore | 3 +-- mmseg/datasets/__init__.py | 21 +++++-------------- mmseg/datasets/pascal_context.py | 36 ++++++++++++++++---------------- 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 081de14b45..2f7fdaf5e1 100644 --- a/.gitignore +++ b/.gitignore @@ -115,8 +115,7 @@ work_dirs/ # temp file or folder /temp*/ -/temp*.py -/temp*.txt +/temp*.* # Pytorch *.pth diff --git a/mmseg/datasets/__init__.py b/mmseg/datasets/__init__.py index 3612a6e86e..ebeaef4a28 100644 --- a/mmseg/datasets/__init__.py +++ b/mmseg/datasets/__init__.py @@ -11,20 +11,9 @@ from .voc import PascalVOCDataset __all__ = [ - 'CustomDataset', - 'build_dataloader', - 'ConcatDataset', - 'RepeatDataset', - 'DATASETS', - 'build_dataset', - 'PIPELINES', - 'CityscapesDataset', - 'PascalVOCDataset', - 'ADE20KDataset', - 'PascalContextDataset', - 'PascalContextDataset59', - 'ChaseDB1Dataset', - 'DRIVEDataset', - 'HRFDataset', - 'STAREDataset', + 'CustomDataset', 'build_dataloader', 'ConcatDataset', 'RepeatDataset', + 'DATASETS', 'build_dataset', 'PIPELINES', 'CityscapesDataset', + 'PascalVOCDataset', 'ADE20KDataset', 'PascalContextDataset', + 'PascalContextDataset59', 'ChaseDB1Dataset', 'DRIVEDataset', 'HRFDataset', + 'STAREDataset' ] diff --git a/mmseg/datasets/pascal_context.py b/mmseg/datasets/pascal_context.py index d99252b498..541a63c66a 100644 --- a/mmseg/datasets/pascal_context.py +++ b/mmseg/datasets/pascal_context.py @@ -17,15 +17,15 @@ class PascalContextDataset(CustomDataset): split (str): Split txt file for PascalContext. """ - CLASSES = ('background', 'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', - 'bus', 'car', 'cat', 'chair', 'cow', 'table', 'dog', 'horse', - 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', - 'tvmonitor', 'bag', 'bed', 'bench', 'book', 'building', - 'cabinet', 'ceiling', 'cloth', 'computer', 'cup', 'door', - 'fence', 'floor', 'flower', 'food', 'grass', 'ground', - 'keyboard', 'light', 'mountain', 'mouse', 'curtain', 'platform', - 'sign', 'plate', 'road', 'rock', 'shelves', 'sidewalk', 'sky', - 'snow', 'bedclothes', 'track', 'tree', 'truck', 'wall', 'water', + CLASSES = ('background', 'aeroplane', 'bag', 'bed', 'bedclothes', 'bench', + 'bicycle', 'bird', 'boat', 'book', 'bottle', 'building', 'bus', + 'cabinet', 'car', 'cat', 'ceiling', 'chair', 'cloth', + 'computer', 'cow', 'cup', 'curtain', 'dog', 'door', 'fence', + 'floor', 'flower', 'food', 'grass', 'ground', 'horse', + 'keyboard', 'light', 'motorbike', 'mountain', 'mouse', 'person', + 'plate', 'platform', 'pottedplant', 'road', 'rock', 'sheep', + 'shelves', 'sidewalk', 'sign', 'sky', 'snow', 'sofa', 'table', + 'track', 'train', 'tree', 'truck', 'tvmonitor', 'wall', 'water', 'window', 'wood') PALETTE = [[120, 120, 120], [180, 120, 120], [6, 230, 230], [80, 50, 50], @@ -67,15 +67,15 @@ class PascalContextDataset59(CustomDataset): split (str): Split txt file for PascalContext. """ - CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', - 'cat', 'chair', 'cow', 'table', 'dog', 'horse', 'motorbike', - 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor', - 'bag', 'bed', 'bench', 'book', 'building', 'cabinet', 'ceiling', - 'cloth', 'computer', 'cup', 'door', 'fence', 'floor', 'flower', - 'food', 'grass', 'ground', 'keyboard', 'light', 'mountain', - 'mouse', 'curtain', 'platform', 'sign', 'plate', 'road', 'rock', - 'shelves', 'sidewalk', 'sky', 'snow', 'bedclothes', 'track', - 'tree', 'truck', 'wall', 'water', 'window', 'wood') + CLASSES = ('aeroplane', 'bag', 'bed', 'bedclothes', 'bench', 'bicycle', + 'bird', 'boat', 'book', 'bottle', 'building', 'bus', 'cabinet', + 'car', 'cat', 'ceiling', 'chair', 'cloth', 'computer', 'cow', + 'cup', 'curtain', 'dog', 'door', 'fence', 'floor', 'flower', + 'food', 'grass', 'ground', 'horse', 'keyboard', 'light', + 'motorbike', 'mountain', 'mouse', 'person', 'plate', 'platform', + 'pottedplant', 'road', 'rock', 'sheep', 'shelves', 'sidewalk', + 'sign', 'sky', 'snow', 'sofa', 'table', 'track', 'train', + 'tree', 'truck', 'tvmonitor', 'wall', 'water', 'window', 'wood') PALETTE = [[180, 120, 120], [6, 230, 230], [80, 50, 50], [4, 200, 3], [120, 120, 80], [140, 140, 140], [204, 5, 255], [230, 230, 230], From 2de91d7f5fea2e3219bd7ceecc7b186645c29749 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Fri, 16 Apr 2021 11:00:30 +0800 Subject: [PATCH 07/11] Add "fcn", "deeplabv3", "deeplabv3+", "pspnet" config file for model training based on PascalContextDataset59; Add some ignore items in ".gitignore"; --- .gitignore | 2 ++ .../deeplabv3_r101-d8_480x480_40k_pascal_context_59.py | 2 ++ .../deeplabv3_r101-d8_480x480_80k_pascal_context_59.py | 2 ++ .../deeplabv3_r50-d8_480x480_40k_pascal_context_59.py | 10 ++++++++++ .../deeplabv3_r50-d8_480x480_80k_pascal_context_59.py | 10 ++++++++++ ...plabv3plus_r101-d8_480x480_40k_pascal_context_59.py | 2 ++ ...plabv3plus_r101-d8_480x480_80k_pascal_context_59.py | 2 ++ ...eplabv3plus_r50-d8_480x480_40k_pascal_context_59.py | 10 ++++++++++ ...eplabv3plus_r50-d8_480x480_80k_pascal_context_59.py | 10 ++++++++++ .../fcn/fcn_r101-d8_480x480_40k_pascal_context_59.py | 2 ++ .../fcn/fcn_r101-d8_480x480_80k_pascal_context_59.py | 2 ++ .../fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py | 1 + .../fcn/fcn_r50-d8_480x480_80k_pascal_context_59.py | 10 ++++++++++ .../pspnet_r101-d8_480x480_40k_pascal_context_59.py | 2 ++ .../pspnet_r101-d8_480x480_80k_pascal_context_59.py | 2 ++ .../pspnet_r50-d8_480x480_40k_pascal_context_59.py | 9 +++++++++ .../pspnet_r50-d8_480x480_80k_pascal_context_59.py | 9 +++++++++ 17 files changed, 87 insertions(+) create mode 100644 configs/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/fcn/fcn_r101-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/fcn/fcn_r101-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/fcn/fcn_r50-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59.py create mode 100644 configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py create mode 100644 configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py diff --git a/.gitignore b/.gitignore index 2f7fdaf5e1..265b6fea07 100644 --- a/.gitignore +++ b/.gitignore @@ -108,10 +108,12 @@ data .idea # custom +*.npy *.pkl *.pkl.json *.log.json work_dirs/ +backup/ # temp file or folder /temp*/ diff --git a/configs/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59.py b/configs/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..4874121fd0 --- /dev/null +++ b/configs/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './deeplabv3_r50-d8_480x480_40k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59.py b/configs/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..032dc8b621 --- /dev/null +++ b/configs/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './deeplabv3_r50-d8_480x480_80k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context_59.py b/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..038993c6a4 --- /dev/null +++ b/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = [ + '../_base_/models/deeplabv3_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_40k.py' +] +model = dict( + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context_59.py b/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..bcdc0b459d --- /dev/null +++ b/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = [ + '../_base_/models/deeplabv3_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_80k.py' +] +model = dict( + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59.py b/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..36a510ff41 --- /dev/null +++ b/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './deeplabv3plus_r50-d8_480x480_40k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59.py b/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..a6a7688c7a --- /dev/null +++ b/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context_59.py b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..f9e831bcd1 --- /dev/null +++ b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = [ + '../_base_/models/deeplabv3plus_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_40k.py' +] +model = dict( + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..d2af575df7 --- /dev/null +++ b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = [ + '../_base_/models/deeplabv3plus_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_80k.py' +] +model = dict( + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/fcn/fcn_r101-d8_480x480_40k_pascal_context_59.py b/configs/fcn/fcn_r101-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..908f4bff00 --- /dev/null +++ b/configs/fcn/fcn_r101-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './fcn_r50-d8_480x480_40k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/fcn/fcn_r101-d8_480x480_80k_pascal_context_59.py b/configs/fcn/fcn_r101-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..09cb612e42 --- /dev/null +++ b/configs/fcn/fcn_r101-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './fcn_r50-d8_480x480_80k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py b/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py index aac0f7600c..4a8180038b 100644 --- a/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py +++ b/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context_59.py @@ -5,5 +5,6 @@ ] model = dict( decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context_59.py b/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..02507ccb7e --- /dev/null +++ b/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,10 @@ +_base_ = [ + '../_base_/models/fcn_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_80k.py' +] +model = dict( + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59.py b/configs/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..081cb3732a --- /dev/null +++ b/configs/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './pspnet_r50-d8_480x480_40k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59.py b/configs/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..795c51f8cf --- /dev/null +++ b/configs/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,2 @@ +_base_ = './pspnet_r50-d8_480x480_80k_pascal_context_59.py' +model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) diff --git a/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py b/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py new file mode 100644 index 0000000000..c7ef488c76 --- /dev/null +++ b/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py @@ -0,0 +1,9 @@ +_base_ = [ + '../_base_/models/pspnet_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_40k.py' +] +model = dict( + decode_head=dict(num_classes=59), auxiliary_head=dict(num_classes=59)) +test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py b/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py new file mode 100644 index 0000000000..5d96abd5bd --- /dev/null +++ b/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py @@ -0,0 +1,9 @@ +_base_ = [ + '../_base_/models/pspnet_r50-d8.py', + '../_base_/datasets/pascal_context_59.py', '../_base_/default_runtime.py', + '../_base_/schedules/schedule_80k.py' +] +model = dict( + decode_head=dict(num_classes=59), auxiliary_head=dict(num_classes=59)) +test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) +optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) From 9fb99b4cda3eb681d29dd3d0d4536aa12e18057b Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Fri, 16 Apr 2021 11:40:49 +0800 Subject: [PATCH 08/11] fix the bug "test_cfg specified in both outer field and model field " of pspnet config file; --- configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context.py | 5 +++-- .../pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py | 5 +++-- configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context.py | 5 +++-- .../pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context.py b/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context.py index 86da94de5b..30abe46e70 100644 --- a/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context.py +++ b/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_40k.py' ] model = dict( - decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=60), + auxiliary_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py b/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py index c7ef488c76..88041c6817 100644 --- a/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py +++ b/configs/pspnet/pspnet_r50-d8_480x480_40k_pascal_context_59.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_40k.py' ] model = dict( - decode_head=dict(num_classes=59), auxiliary_head=dict(num_classes=59)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context.py b/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context.py index cbb02714b9..09e96dabf7 100644 --- a/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context.py +++ b/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_80k.py' ] model = dict( - decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=60), + auxiliary_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py b/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py index 5d96abd5bd..d4065ec05c 100644 --- a/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py +++ b/configs/pspnet/pspnet_r50-d8_480x480_80k_pascal_context_59.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_80k.py' ] model = dict( - decode_head=dict(num_classes=59), auxiliary_head=dict(num_classes=59)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=59), + auxiliary_head=dict(num_classes=59), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) From efa651e61765adb849445e7d47cf68c6220d3e70 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Mon, 19 Apr 2021 16:57:12 +0800 Subject: [PATCH 09/11] * Clean unnecessary codes; * Add weighs link, config link, log link and evaluation results about PascalContextDataset59 in README.md --- .gitignore | 6 ------ configs/_base_/schedules/schedule_20k_epochwise.py | 9 --------- configs/deeplabv3/README.md | 7 +++++++ configs/deeplabv3plus/README.md | 7 +++++++ configs/fcn/README.md | 7 +++++++ configs/hrnet/README.md | 7 +++++++ configs/pspnet/README.md | 7 +++++++ 7 files changed, 35 insertions(+), 15 deletions(-) delete mode 100644 configs/_base_/schedules/schedule_20k_epochwise.py diff --git a/.gitignore b/.gitignore index 265b6fea07..9b7cffbc88 100644 --- a/.gitignore +++ b/.gitignore @@ -108,16 +108,10 @@ data .idea # custom -*.npy *.pkl *.pkl.json *.log.json work_dirs/ -backup/ - -# temp file or folder -/temp*/ -/temp*.* # Pytorch *.pth diff --git a/configs/_base_/schedules/schedule_20k_epochwise.py b/configs/_base_/schedules/schedule_20k_epochwise.py deleted file mode 100644 index 295098cfdb..0000000000 --- a/configs/_base_/schedules/schedule_20k_epochwise.py +++ /dev/null @@ -1,9 +0,0 @@ -# optimizer -optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) -optimizer_config = dict() -# learning policy -lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=True) -# runtime settings -runner = dict(type='IterBasedRunner', max_iters=20000) -checkpoint_config = dict(by_epoch=True, interval=2000) -evaluation = dict(interval=2000, metric='mIoU') diff --git a/configs/deeplabv3/README.md b/configs/deeplabv3/README.md index c4994f6469..d636c18948 100644 --- a/configs/deeplabv3/README.md +++ b/configs/deeplabv3/README.md @@ -64,3 +64,10 @@ Note: `D-8` here corresponding to the output stride 8 setting for DeepLab series |-----------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | DeepLabV3 | R-101-D8 | 480x480 | 40000 | 9.2 | 7.09 | 46.55 | 47.81 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context/deeplabv3_r101-d8_480x480_40k_pascal_context_20200911_204118-1aa27336.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context/deeplabv3_r101-d8_480x480_40k_pascal_context-20200911_204118.log.json) | | DeepLabV3 | R-101-D8 | 480x480 | 80000 | - | - | 46.42 | 47.53 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context/deeplabv3_r101-d8_480x480_80k_pascal_context_20200911_170155-2a21fff3.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context/deeplabv3_r101-d8_480x480_80k_pascal_context-20200911_170155.log.json) | + +### Pascal Context 59 + +| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download | +| --------- | -------- | --------- | ------: | -------- | -------------- | ----: | ------------: | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| DeepLabV3 | R-101-D8 | 480x480 | 40000 | - | - | 52.61 | 54.28 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59/deeplabv3_r101-d8_480x480_40k_pascal_context_59_20210416_110332-cb08ea46.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context_59/deeplabv3_r101-d8_480x480_40k_pascal_context_59-20210416_110332.log.json) | +| DeepLabV3 | R-101-D8 | 480x480 | 80000 | - | - | 52.46 | 54.09 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59/deeplabv3_r101-d8_480x480_80k_pascal_context_59_20210416_113002-26303993.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context_59/deeplabv3_r101-d8_480x480_80k_pascal_context_59-20210416_113002.log.json) | diff --git a/configs/deeplabv3plus/README.md b/configs/deeplabv3plus/README.md index dc02660428..c3320beb43 100644 --- a/configs/deeplabv3plus/README.md +++ b/configs/deeplabv3plus/README.md @@ -66,3 +66,10 @@ Note: |------------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | DeepLabV3+ | R-101-D8 | 480x480 | 40000 | - | 9.09 | 47.30 | 48.47 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context/deeplabv3plus_r101-d8_480x480_40k_pascal_context_20200911_165459-d3c8a29e.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context/deeplabv3plus_r101-d8_480x480_40k_pascal_context-20200911_165459.log.json) | | DeepLabV3+ | R-101-D8 | 480x480 | 80000 | - | - | 47.23 | 48.26 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context/deeplabv3plus_r101-d8_480x480_80k_pascal_context_20200911_155322-145d3ee8.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context/deeplabv3plus_r101-d8_480x480_80k_pascal_context-20200911_155322.log.json) | + +#### Pascal Context 59 + +| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download | +| ---------- | -------- | --------- | ------: | -------- | -------------- | ----: | ------------: | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| DeepLabV3+ | R-101-D8 | 480x480 | 40000 | - | - | 52.86 | 54.54 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59_20210416_111233-ed937f15.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59/deeplabv3plus_r101-d8_480x480_40k_pascal_context_59-20210416_111233.log.json) | +| DeepLabV3+ | R-101-D8 | 480x480 | 80000 | - | - | 53.2 | 54.67 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59_20210416_111127-7ca0331d.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59-20210416_111127.log.json) | diff --git a/configs/fcn/README.md b/configs/fcn/README.md index f3b6433cda..022eee91fe 100644 --- a/configs/fcn/README.md +++ b/configs/fcn/README.md @@ -76,3 +76,10 @@ |--------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | FCN | R-101-D8 | 480x480 | 40000 | - | 9.93 | 44.14 | 45.67 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_40k_pascal_context/fcn_r101-d8_480x480_40k_pascal_context_20200911_212515-9b565a6d.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_40k_pascal_context/fcn_r101-d8_480x480_40k_pascal_context-20200911_212515.log.json) | | FCN | R-101-D8 | 480x480 | 80000 | - | - | 44.47 | 45.74 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_80k_pascal_context/fcn_r101-d8_480x480_80k_pascal_context_20200915_032644-a3828480.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_80k_pascal_context/fcn_r101-d8_480x480_80k_pascal_context-20200915_032644.log.json) | + +### Pascal Context 59 + +| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download | +| ------ | -------- | --------- | ------: | -------- | -------------- | ----: | ------------: | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| FCN | R-101-D8 | 480x480 | 40000 | - | - | 48.42 | 50.4 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/fcn/fcn_r101-d8_480x480_40k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_40k_pascal_context_59/fcn_r101-d8_480x480_40k_pascal_context_59_20210415_230724-8cf83682.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_40k_pascal_context_59/fcn_r101-d8_480x480_40k_pascal_context_59-20210415_230724.log.json) | +| FCN | R-101-D8 | 480x480 | 80000 | - | - | 49.35 | 51.38 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/fcn/fcn_r101-d8_480x480_80k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_80k_pascal_context_59/fcn_r101-d8_480x480_80k_pascal_context_59_20210416_110804-9a6f2c94.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/fcn/fcn_r101-d8_480x480_80k_pascal_context_59/fcn_r101-d8_480x480_80k_pascal_context_59-20210416_110804.log.json) | diff --git a/configs/hrnet/README.md b/configs/hrnet/README.md index 4d77cefe3e..2df6ec5b40 100644 --- a/configs/hrnet/README.md +++ b/configs/hrnet/README.md @@ -57,3 +57,10 @@ |--------|--------------------|-----------|--------:|----------|----------------|------:|--------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | FCN | HRNetV2p-W48 | 480x480 | 40000 | 6.1 | 8.86 | 45.14 | 47.42 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_40k_pascal_context/fcn_hr48_480x480_40k_pascal_context_20200911_164852-667d00b0.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_40k_pascal_context/fcn_hr48_480x480_40k_pascal_context-20200911_164852.log.json) | | FCN | HRNetV2p-W48 | 480x480 | 80000 | - | - | 45.84 | 47.84 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_80k_pascal_context/fcn_hr48_480x480_80k_pascal_context_20200911_155322-847a6711.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_80k_pascal_context/fcn_hr48_480x480_80k_pascal_context-20200911_155322.log.json) | + +### Pascal Context 59 + +| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download | +| ------ | ------------ | --------- | ------: | -------- | -------------- | ----: | ------------: | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FCN | HRNetV2p-W48 | 480x480 | 40000 | - | - | 50.33 | 52.83 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr48_480x480_40k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_40k_pascal_context_59/fcn_hr48_480x480_40k_pascal_context_59_20210410_122738-b808b8b2.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_40k_pascal_context_59/fcn_hr48_480x480_40k_pascal_context_59-20210410_122738.log.json) | +| FCN | HRNetV2p-W48 | 480x480 | 80000 | - | - | 51.12 | 53.56 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr48_480x480_80k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_80k_pascal_context_59/fcn_hr48_480x480_80k_pascal_context_59_20210411_003240-3ae7081e.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_80k_pascal_context_59/fcn_hr48_480x480_80k_pascal_context_59-20210411_003240.log.json) | diff --git a/configs/pspnet/README.md b/configs/pspnet/README.md index 931cad9006..0a72730b55 100644 --- a/configs/pspnet/README.md +++ b/configs/pspnet/README.md @@ -60,3 +60,10 @@ |--------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | PSPNet | R-101-D8 | 480x480 | 40000 | 8.8 | 9.68 | 46.60 | 47.78 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_40k_pascal_context/pspnet_r101-d8_480x480_40k_pascal_context_20200911_211210-bf0f5d7c.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_40k_pascal_context/pspnet_r101-d8_480x480_40k_pascal_context-20200911_211210.log.json) | | PSPNet | R-101-D8 | 480x480 | 80000 | - | - | 46.03 | 47.15 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_80k_pascal_context/pspnet_r101-d8_480x480_80k_pascal_context_20200911_190530-c86d6233.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_80k_pascal_context/pspnet_r101-d8_480x480_80k_pascal_context-20200911_190530.log.json) | + +### Pascal Context 59 + +| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download | +| ------ | -------- | --------- | ------: | -------- | -------------- | ----: | ------------: | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| PSPNet | R-101-D8 | 480x480 | 40000 | - | - | 52.02 | 53.54 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59/pspnet_r101-d8_480x480_40k_pascal_context_59_20210416_114524-86d44cd4.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_40k_pascal_context_59/pspnet_r101-d8_480x480_40k_pascal_context_59-20210416_114524.log.json) | +| PSPNet | R-101-D8 | 480x480 | 80000 | - | - | 52.47 | 53.99 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59/pspnet_r101-d8_480x480_80k_pascal_context_59_20210416_114418-fa6caaa2.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59/pspnet_r101-d8_480x480_80k_pascal_context_59-20210416_114418.log.json) | From d463783f5ef1ffe9426046478d1355adef5f4876 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Mon, 19 Apr 2021 17:51:37 +0800 Subject: [PATCH 10/11] Add command line argument: "-p | --port", this arg can change the transmit port when you transmit data to distributed machine. --- tools/test.py | 8 ++++++++ tools/train.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/tools/test.py b/tools/test.py index c074fcc4bb..3ed22efa65 100644 --- a/tools/test.py +++ b/tools/test.py @@ -17,6 +17,11 @@ def parse_args(): description='mmseg test (and eval) a model') parser.add_argument('config', help='test config file path') parser.add_argument('checkpoint', help='checkpoint file') + parser.add_argument( + '-p', + '--port', + default='25900', + help='The data transmit port when distributed training.') parser.add_argument( '--aug-test', action='store_true', help='Use Flip and Multi scale aug') parser.add_argument('--out', help='output result file in pickle format') @@ -85,6 +90,9 @@ def main(): cfg = mmcv.Config.fromfile(args.config) if args.options is not None: cfg.merge_from_dict(args.options) + # set transmit port + if args.port != '25900': + cfg.dist_params['port'] = args.port # set cudnn_benchmark if cfg.get('cudnn_benchmark', False): torch.backends.cudnn.benchmark = True diff --git a/tools/train.py b/tools/train.py index 51fe4065de..a8f9fbd472 100644 --- a/tools/train.py +++ b/tools/train.py @@ -28,6 +28,11 @@ def parse_args(): '--no-validate', action='store_true', help='whether not to evaluate the checkpoint during training') + parser.add_argument( + '-p', + '--port', + default='25900', + help='The data transmit port when distributed training.') group_gpus = parser.add_mutually_exclusive_group() group_gpus.add_argument( '--gpus', @@ -66,6 +71,9 @@ def main(): cfg = Config.fromfile(args.config) if args.options is not None: cfg.merge_from_dict(args.options) + # set transmit port + if args.port != '25900': + cfg.dist_params['port'] = args.port # set cudnn_benchmark if cfg.get('cudnn_benchmark', False): torch.backends.cudnn.benchmark = True From a76899132470bbb77dbd71a59b4f89644dcaa9b5 Mon Sep 17 00:00:00 2001 From: sennnnn <201730271412@mail.scut.edu.cn> Date: Tue, 20 Apr 2021 11:06:38 +0800 Subject: [PATCH 11/11] * Remove rebundant config files; * Remove "-p|--port" command argument; --- configs/_base_/schedules/schedule_160k_epochwise.py | 9 --------- configs/_base_/schedules/schedule_40k_epochwise.py | 9 --------- configs/_base_/schedules/schedule_80k_epochwisse.py | 9 --------- tools/test.py | 8 -------- tools/train.py | 8 -------- 5 files changed, 43 deletions(-) delete mode 100644 configs/_base_/schedules/schedule_160k_epochwise.py delete mode 100644 configs/_base_/schedules/schedule_40k_epochwise.py delete mode 100644 configs/_base_/schedules/schedule_80k_epochwisse.py diff --git a/configs/_base_/schedules/schedule_160k_epochwise.py b/configs/_base_/schedules/schedule_160k_epochwise.py deleted file mode 100644 index 1da307e680..0000000000 --- a/configs/_base_/schedules/schedule_160k_epochwise.py +++ /dev/null @@ -1,9 +0,0 @@ -# optimizer -optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) -optimizer_config = dict() -# learning policy -lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) -# runtime settings -runner = dict(type='IterBasedRunner', max_iters=160000) -checkpoint_config = dict(by_epoch=True, interval=16000) -evaluation = dict(interval=16000, metric='mIoU') diff --git a/configs/_base_/schedules/schedule_40k_epochwise.py b/configs/_base_/schedules/schedule_40k_epochwise.py deleted file mode 100644 index 549d20161c..0000000000 --- a/configs/_base_/schedules/schedule_40k_epochwise.py +++ /dev/null @@ -1,9 +0,0 @@ -# optimizer -optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) -optimizer_config = dict() -# learning policy -lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=True) -# runtime settings -runner = dict(type='IterBasedRunner', max_iters=40000) -checkpoint_config = dict(by_epoch=True, interval=4000) -evaluation = dict(interval=4000, metric='mIoU') diff --git a/configs/_base_/schedules/schedule_80k_epochwisse.py b/configs/_base_/schedules/schedule_80k_epochwisse.py deleted file mode 100644 index 371dba1e7d..0000000000 --- a/configs/_base_/schedules/schedule_80k_epochwisse.py +++ /dev/null @@ -1,9 +0,0 @@ -# optimizer -optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) -optimizer_config = dict() -# learning policy -lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) -# runtime settings -runner = dict(type='IterBasedRunner', max_iters=80000) -checkpoint_config = dict(by_epoch=True, interval=8000) -evaluation = dict(interval=8000, metric='mIoU') diff --git a/tools/test.py b/tools/test.py index 3ed22efa65..c074fcc4bb 100644 --- a/tools/test.py +++ b/tools/test.py @@ -17,11 +17,6 @@ def parse_args(): description='mmseg test (and eval) a model') parser.add_argument('config', help='test config file path') parser.add_argument('checkpoint', help='checkpoint file') - parser.add_argument( - '-p', - '--port', - default='25900', - help='The data transmit port when distributed training.') parser.add_argument( '--aug-test', action='store_true', help='Use Flip and Multi scale aug') parser.add_argument('--out', help='output result file in pickle format') @@ -90,9 +85,6 @@ def main(): cfg = mmcv.Config.fromfile(args.config) if args.options is not None: cfg.merge_from_dict(args.options) - # set transmit port - if args.port != '25900': - cfg.dist_params['port'] = args.port # set cudnn_benchmark if cfg.get('cudnn_benchmark', False): torch.backends.cudnn.benchmark = True diff --git a/tools/train.py b/tools/train.py index a8f9fbd472..51fe4065de 100644 --- a/tools/train.py +++ b/tools/train.py @@ -28,11 +28,6 @@ def parse_args(): '--no-validate', action='store_true', help='whether not to evaluate the checkpoint during training') - parser.add_argument( - '-p', - '--port', - default='25900', - help='The data transmit port when distributed training.') group_gpus = parser.add_mutually_exclusive_group() group_gpus.add_argument( '--gpus', @@ -71,9 +66,6 @@ def main(): cfg = Config.fromfile(args.config) if args.options is not None: cfg.merge_from_dict(args.options) - # set transmit port - if args.port != '25900': - cfg.dist_params['port'] = args.port # set cudnn_benchmark if cfg.get('cudnn_benchmark', False): torch.backends.cudnn.benchmark = True