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

[WIP][Feature] Support RTMDet-Ins fast training #649

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

RangiLyu
Copy link
Member

@RangiLyu RangiLyu commented Mar 9, 2023

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Training RTMDet-Ins-s costs 19h. It is 2.8 times faster than MMDetection.

@RangiLyu RangiLyu changed the title [WIP][Feature] Support RTMDet-Ins training [WIP][Feature] Support RTMDet-Ins fast training Mar 9, 2023
persistent_workers = True

# -----train val related-----
# Base learning rate for optim_wrapper. Corresponding to 8xb16=64 bs
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Base learning rate for optim_wrapper. Corresponding to 8xb16=64 bs
# Base learning rate for optim_wrapper. Corresponding to 8xb32=256 bs

multi_label=True,
# The number of boxes before NMS
nms_pre=1000,
score_thr=0.05, # Threshold to filter out boxes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可以加个注释说明:实例分割任务相比目标检测后处理速度更慢,因此需要加大 score_thr 和减少 nms_pre 和 max_per_img 等参数

dict(type='mmdet.PackDetInputs')
]

train_pipeline_stage2 = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

可以用简化写法: _base_.train_pipeline_stage2[2].ratio_range=random_resize_ratio_range

for i, (weight, bias) in enumerate(zip(weights, biases)):
x = F.conv2d(
x, weight, bias=bias, stride=1, padding=0, groups=num_inst)
x = torch.einsum('nij,njhw->nihw', weight, x)
Copy link
Collaborator

Choose a reason for hiding this comment

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

我们可以保留 F.conv2d( 的实现,并注释掉。说明新的写法更快?

Copy link
Member Author

Choose a reason for hiding this comment

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

conv2d 的 kernel shape 和 einsum 有点区别

for i, (weight, bias) in enumerate(zip(weights, biases)):
x = F.conv2d(
x, weight, bias=bias, stride=1, padding=0, groups=num_inst)
x = torch.einsum('nij,njhw->nihw', weight, x)
Copy link
Collaborator

Choose a reason for hiding this comment

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

可以加个注释,说明下做了什么,和速度提升情况

@@ -0,0 +1,340 @@
_base_ = ['../_base_/default_runtime.py']
Copy link
Collaborator

Choose a reason for hiding this comment

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

配置应该是放到 config/rtmdet/ins_seg 下比较好?更好管理?你觉得呢

@collinmccarthy
Copy link

Is this still a planned feature or WIP? Would love to be able to train the RTMDet-Ins model but I'm not 100% sure what changes I need to make. It seems like part of this PR has been merged for YOLOv5-Ins but part has not, so I'm not sure what the plan is here. Any update here would be much appreciated!

Also related to #853.

@rbli-john
Copy link

@RangiLyu hi, may I ask what is the current status of this feature? Look forward to seeing the fast training for Rtmdet-instance-segmentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants