在计算 SAN 模型的 FLOPs 和参数时,get_flops.py 发生错误,原因是 SideAdapterCLIPHead 前向签名不匹配
I am using MMSEG version 1.2.2. When I want to run 'get_flops.py' to calculate the FLOPs and Param of the SAN segmentation model, an error occurs. Specifically, when I run the command `none Python mmsegmentation/tools/analysis_tools/get_flops.py san-vit-b16_xxx-640x640.py --shape 1024` or a related command, an error occurs: `none TypeError: SideAdapterCLIPHead.forward() missing 1 required positional argument: 'deep_supervision_idxs'`. The specific reason is that the SAN decode_head requires the parameter `deep_supervision_idxs` when performing forward computation, but the method used by the MultimodalEncoderDecoder is to directly input the encoder's result into the decoder. If we try to solve this problem by adding this parameter directly in the code, there will be discrepancies between the x obtained by the encoder and the x required by the decoder, for example:
内容来源: open-mmlab/mmsegmentation