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

fix:Fix two of the CO-DETR config files #11809

Open
wants to merge 1 commit into
base: dev-3.x
Choose a base branch
from

Conversation

Zzzan
Copy link

@Zzzan Zzzan commented Jun 21, 2024

Motivation

The motivation of this PR is to fix one of the config files for CO-DETR project. Currently, running

python tools/train.py /home/baiye/mamba-test/mmdetection-main/projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_3x_coco.py

throws a following exception:

AssertionError: Each parameter scheduler should contain the key type, but got {'milestones': [30]}

I assume that when modifying a particular item within a list, users are required to add a type key to distinguish it from other possible items in that particular list.

Modification

This PR resolves the error by adding the type key that is inherited from some of the base configs:
co_dino_5scale_swin_l_16xb1_3x_coco.py
co_dino_5scale_r50_lsj_8xb2_3x_coco.py

BC-breaking (Optional)

N/A

Use cases (Optional)

Anyone extending the modified config can now do so without running into this error.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMPreTrain.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented Jun 21, 2024

CLA assistant check
All committers have signed the CLA.

@@ -1,4 +1,4 @@
_base_ = ['co_dino_5scale_r50_lsj_8xb2_1x_coco.py']

param_scheduler = [dict(milestones=[30])]
param_scheduler = [dict(type='MultiStepLR', milestones=[30])]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to do it like in base?

https://github.com/open-mmlab/mmdetection/blob/main/projects/CO-DETR/configs/codino/co_dino_5scale_r50_lsj_8xb2_1x_coco.py#L335

max_epochs = 12
train_cfg = dict(max_epochs=max_epochs)

param_scheduler = [
    dict(
        type='MultiStepLR',
        begin=0,# Defaults to 0.
        end=max_epochs, # Defaults to INF.
        by_epoch=True, # Defaults to True
        milestones=[30],
        gamma=0.1) # gamma=0.1 - default
]

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

Successfully merging this pull request may close these issues.

4 participants