sail-sg / inceptionnext

InceptionNeXt: When Inception Meets ConvNeXt (CVPR 2024)

Home Page:https://arxiv.org/abs/2303.16900

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inceptionnext performance

suisui-su-crtl opened this issue · comments

Hello, I tried to use inceptionnext as the encoder, but the experiment results are not ideal ( The performance is even worse than convnext, I think maybe I made a mistake), can you help me to see if there is a problem with my code?

Since the encoder is connected to the decoder at each layer, I need to extract the results of each layer.

original:

def forward(self, x):
    x = self.forward_features(x)
    x = self.forward_head(x)  # I removed this part of the code because of the encoder
    return x

I modified:

def forward(self, x):
    y = x
    y = self.stem(y)
    y = self.stages[0] (y)
    x1 = y
    
    y = self.stages[1] (y)
    x2 = y
    
    y = self.stages[2] (y)
    x3 = y
    
    y = self.stages[3] (y)
    x4 = y
    
    return x1, x2, x3, x4

Hi, for the semantic segmentation task in the paper, we add SyncBN for the output of each stage, like
return syncbn1(x1), syncbn2(x2), syncbn3(x3), syncbn4(x4).

Thank you very much for your help. My research area is semantic segmentation.

Do you mean to add SyncBN layer after the output of each layer?

I have some questions about SyncBN layer.

I don't see the use of SyncBN in code. Do I need to add it by myself?

I use a single card for training, search found that SyncBN can support multi-card training, syncbn is useful for my training? Or is it more appropriate to directly add a BN layer?

Looking forward to your reply, which is very important to me.

Hi, yes, BN needs to add for the semantic segmentation task. For a single GPU, BN is equal to SyncBN. For multi-GPU training, please remember to use SyncBN.

in instance segmentation task,I didn't use the BN for the output of each stage,and my result of experiment is bad.

I don't know the reason.I use inceptionnext-tiny to replace resnet50, why the result is worse.

Hi @116022017144 ,

Besides adding SyncBN for the output of each stage, remember to replace BN in InceptionNeXt with SyncBN.

ok,thank you!Do all the BN is needed to be replaced?

还有对每个stage输出做SyncBN,这样可以吗?self.stages = nn.Sequential(norm_layer(dims[0])),还是只需要在声明形参那里这样 norm_layer=nn.SyncBatchNorm,就行

这个类class MlpHead(nn.Module),如果做分割任务的话,我看是没有用到的,其norm层不用管了吧?

Hi @116022017144 , yes, I remove all MlpHead for semantic segmentation.

image
I met the error. And my model support distrbuted training.

Hi @116022017144 , yes, I remove all MlpHead for semantic segmentation.

Can you come up with a semantic segmentation version of inceptionnext when you have time? I would really appreciate it if you could!

I added BN layers after each output layer, but the accuracy is only slightly improved, similar to the performance of convnext. I'm having a hard time finding the problem.

image I met the error. And my model support distrbuted training.

Hi, I use MMSeg for semantic segmentation. SyncBN code like this

from mmcv.cnn import build_norm_layer

norm_cfg=dict(type='SyncBN', requires_grad=True)

self.norm = build_norm_layer(norm_cfg, out_chs)[1]

Hi @116022017144 , yes, I remove all MlpHead for semantic segmentation.

Can you come up with a semantic segmentation version of inceptionnext when you have time? I would really appreciate it if you could!

I added BN layers after each output layer, but the accuracy is only slightly improved, similar to the performance of convnext. I'm having a hard time finding the problem.

Hi, sorry that I am so busy recently and may have no time to clean the code. Following ConvNeXt, we report mIoU multi-scale testing in Table 5 in the paper, where InceptionNeXt significantly outperforms ConvNeXt. Besides, I also evaluate it with single scale, finding the performance of InceptionNeXt is similar to ConvNeXt. It seems InceptionNeXt is more in favor of multi-scale testing.

Hi @116022017144 , yes, I remove all MlpHead for semantic segmentation.

Can you come up with a semantic segmentation version of inceptionnext when you have time? I would really appreciate it if you could!
I added BN layers after each output layer, but the accuracy is only slightly improved, similar to the performance of convnext. I'm having a hard time finding the problem.

Hi, sorry that I am so busy recently and may have no time to clean the code. Following ConvNeXt, we report mIoU multi-scale testing in Table 5 in the paper, where InceptionNeXt significantly outperforms ConvNeXt. Besides, I also evaluate it with single scale, finding the performance of InceptionNeXt is similar to ConvNeXt. It seems InceptionNeXt is more in favor of multi-scale testing.

Ok, I can understand. Thank you very much for your help many times. I will read the paper in detail again to find the answer.