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

从 mmseg0.x 迁移至 mmseg 1.x 复现出现问题 #160

Open
AI-Tianlong opened this issue Jan 6, 2024 · 0 comments
Open

从 mmseg0.x 迁移至 mmseg 1.x 复现出现问题 #160

AI-Tianlong opened this issue Jan 6, 2024 · 0 comments

Comments

@AI-Tianlong
Copy link

AI-Tianlong commented Jan 6, 2024

Helllo~大佬。我现在想把ViT-Adapter从mmseg0.x 迁移到 mmseg1.x,并合并到mmseg官方库,以便更多的社区同学使用。但是在复现推理的时候出现了问题,权重中有些关键字不一样已经进行了修改,是能对的上的,但是推理结果是很乱,和没训练一样。在复现BEiT-Adapter的时候,由于mmseg实现的BEiT和您的有些差别,于是我先尝试使用您的BEiT写法,并把相关的库都升级到了最新的mmengine或mmcv或mmseg版本。但是模型权重加载后,推理的结果很差。并且模型训练也不收敛,不知道是否有哪些需要注意的地方,是我没有考虑到的呢?
我现在写了以下的几个文件:

  • BEiT-Adapterbackbone,位于mmseg-models-backbone,BEiTAdapter(BEiT)继承自BEiT,和您的实现完全一致。
  • 配置文件中,使用了mmdet已有的mask2former,并且mask2former的配置文件是从已有的官方库中抄来的。
  • BEiTAdapterMask2Former中的MultiScaleDeformableAttention 使用了mmcv-ops-multi-scale-deform_attn中的内容。
  • 由于我的迁移和您的实现输出结果不一致,于是我去查权重是否正确加载,以及各部分输出是否一致,发现:
  • 在BEiT-Adapter的这里(如下图),在第一次输入进模型时,x,c,cls的值,我的复现和您的输出是完全一致的。但迭代之后,就不一致了,我想这个地方可能会导致后面的推理结果不正确?

image

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

No branches or pull requests

1 participant