SwinTransformer / Swin-Transformer-Object-Detection

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Object Detection and Instance Segmentation.
https://arxiv.org/abs/2103.14030
Apache License 2.0
1.79k stars 379 forks source link

Segm evaluation results are close to 0 #126

Open LZYmixiu opened 2 years ago

LZYmixiu commented 2 years ago

When I train cascade_mask_rcnn_swin_tiny_3x on custom dataset, I found the Segm evaluation results are close to 0 while the Bbox evaluation results is normal. As showed in below:

bbox_mAP: 0.4760, bbox_mAP_50: 0.8410, bbox_mAP_75: 0.5560, bbox_mAP_s: -1.0000, bbox_mAP_m: 0.5310, bbox_mAP_l: -1.0000, bbox_mAP_copypaste: 0.476 0.841 0.556 -1.000 0.531 -1.000
segm_mAP: 0.0000, segm_mAP_50: 0.0020, segm_mAP_75: 0.0000, segm_mAP_s: -1.0000, segm_mAP_m: 0.0040, segm_mAP_l: -1.0000, segm_mAP_copypaste: 0.000 0.002 0.000 -1.000 0.004 -1.000

Here is my config file:

_base_ = './cascade_mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_giou_4conv1f_adamw_3x_coco.py'

# 1. dataset settings
dataset_type = 'CocoDataset'
classes = ('counter_weight',)
data_root = 'personal_dataset/'
data = dict(
    samples_per_gpu=1,
    workers_per_gpu=4,
    train=dict(
        type=dataset_type,
        # explicitly add your class names to the field `classes`
        classes=classes,
        ann_file=data_root + 'annotations/gray_train.json',
        img_prefix=data_root + 'train'),
    val=dict(
        type=dataset_type,
        # explicitly add your class names to the field `classes`
        classes=classes,
        ann_file=data_root + 'annotations/gray_val.json',
        img_prefix=data_root + 'val'),
    test=dict(
        type=dataset_type,
        # explicitly add your class names to the field `classes`
        classes=classes,
        ann_file=data_root + 'annotations/gray_val.json',
        img_prefix=data_root + 'val'))

# 2. model settings

# explicitly over-write all the `num_classes` field.
model = dict(
    roi_head=dict(
        bbox_head=[
            dict(
                type='Shared2FCBBoxHead',
                # explicitly over-write all the `num_classes` field.
                num_classes=1),
            dict(
                type='Shared2FCBBoxHead',
                # explicitly over-write all the `num_classes` field.
                num_classes=1),
            dict(
                type='Shared2FCBBoxHead',
                # explicitly over-write all the `num_classes` field.
                num_classes=1)],
    # explicitly over-write all the `num_classes` field.
    mask_head=dict(num_classes=1)))

runner = dict(type='EpochBasedRunner', max_epochs=24)
log_config = dict(interval=1)

Dose anyone knows what's going on? Thanks!

cccyyy24 commented 2 years ago

请问你解决这个问题了吗 (have you solved it?)

LZYmixiu commented 2 years ago

已经解决啦

---Original--- From: @.> Date: Sat, Jan 22, 2022 21:17 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126)

请问你解决这个问题了吗 (have you solved it?)

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

cccyyy24 commented 2 years ago

已经解决啦 ---Original--- From: @.> Date: Sat, Jan 22, 2022 21:17 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 请问你解决这个问题了吗 (have you solved it?) — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

请问怎么解决,可以分享一下吗

LZYmixiu commented 2 years ago

修改一下batch size试试

---Original--- From: @.> Date: Thu, Feb 24, 2022 17:12 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126)

已经解决啦 … ---Original--- From: @.> Date: Sat, Jan 22, 2022 21:17 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 请问你解决这个问题了吗 (have you solved it?) — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

请问怎么解决,可以分享一下吗

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

cccyyy24 commented 2 years ago

samples_per_gpu=1, workers_per_gpu=1

我的batchsize是这么设定的,请问怎么改

LZYmixiu commented 2 years ago

你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试

---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126)

samples_per_gpu=1, workers_per_gpu=1

我的batchsize是这么设定的,请问怎么改

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

cccyyy24 commented 2 years ago

你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco

LZYmixiu commented 2 years ago

我是自定义的数据集呀  coco的话你调大一点吧

---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126)

你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

cccyyy24 commented 2 years ago

你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

我是自定义的数据集呀  coco的话你调大一点吧 ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.>

我是自定义的数据集呀  coco的话你调大一点吧 ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.>

你好,你改完batchsize后,对精度提升大吗?训练精度可以恢复正常吗

LZYmixiu commented 2 years ago

我是通过调节batch size提升的

---Original--- From: @.> Date: Fri, Feb 25, 2022 19:36 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126)

你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

我是自定义的数据集呀  coco的话你调大一点吧 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.>

我是自定义的数据集呀  coco的话你调大一点吧 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.>

你好,你改完batchsize后,对精度提升大吗?训练精度可以恢复正常吗

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

cccyyy24 commented 2 years ago

你好,我的训练精度很低,我是在官网下载ImageNet1K当做预训练权重加载,在coco数据集上训练,这流程哪里不对吗?还是需要更改什么配置,我看你的检测map是正常的,求求解答一下!!

cccyyy24 commented 2 years ago

你好,我的训练精度很低,我是在官网下载ImageNet1K当做预训练权重加载,在coco数据集上训练,这流程哪里不对吗?还是需要更改什么配置,我看你的检测map是正常的,求求解答一下!!

我是通过调节batch size提升的 ---Original--- From: @.> Date: Fri, Feb 25, 2022 19:36 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我是自定义的数据集呀  coco的话你调大一点吧 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我是自定义的数据集呀  coco的话你调大一点吧 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 你好,你改完batchsize后,对精度提升大吗?训练精度可以恢复正常吗 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.>

你好,我的训练精度很低,我是在官网下载ImageNet1K当做预训练权重加载,在coco数据集上训练,这流程哪里不对吗?还是需要更改什么配置,我看你的检测map是正常的,求求解答一下!!

LZYmixiu commented 2 years ago

流程没什么问题  看看参数设置吧

---Original--- From: @.> Date: Sat, Feb 26, 2022 12:35 PM To: @.>; Cc: @.**@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126)

你好,我的训练精度很低,我是在官网下载ImageNet1K当做预训练权重加载,在coco数据集上训练,这流程哪里不对吗?还是需要更改什么配置,我看你的检测map是正常的,求求解答一下!!

我是通过调节batch size提升的 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 19:36 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我是自定义的数据集呀  coco的话你调大一点吧 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我是自定义的数据集呀  coco的话你调大一点吧 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:38 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) 你几块gpu? 我调成1就不会接近0了  不过我训练集很小 你要不调大试试 … ---Original--- From: @.> Date: Fri, Feb 25, 2022 15:04 PM To: @.>; Cc: @.@.>; Subject: Re: [SwinTransformer/Swin-Transformer-Object-Detection] Segmevaluation results are close to 0 (Issue #126) samples_per_gpu=1, workers_per_gpu=1 我的batchsize是这么设定的,请问怎么改 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 我一共2块gpu,请问什么叫训练集很小?我的训练集就是coco — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.> 你好,你改完batchsize后,对精度提升大吗?训练精度可以恢复正常吗 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.>

你好,我的训练精度很低,我是在官网下载ImageNet1K当做预训练权重加载,在coco数据集上训练,这流程哪里不对吗?还是需要更改什么配置,我看你的检测map是正常的,求求解答一下!!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>