Have you checked the decoupled head in:

  

      github.com
  

  
    quanghona/SOLO_tf2/blob/master/model/layers/head.py#L47



      
      
              self.cat_convs.append(cat_conv)
          cat_conv_out = tf.keras.layers.Conv2D(self.num_class, (3,3), 1, padding="same",
                                                  kernel_initializer=tf.keras.initializers.glorot_uniform(),
                                                  activation="sigmoid")
          self.cat_convs.append(cat_conv_out)
          
          # Mask branch
          if head_style == 'vanilla':
              num_mask_branch = 1
              mask_out_num_channel = grid_sizes[0]*grid_sizes[0]
          elif head_style == 'decoupled':
              num_mask_branch = 2
              mask_out_num_channel = grid_sizes[0]
          else:
              raise ValueError(f"Head style {head_style} not supported")
          mask_conv_channels = [[self.num_channel, self.num_channel]] * num_mask_branch # number of channels for all sub-branchs in mask branchs
          
          for branch_channels in mask_conv_channels:
              branch_conv = []
              branch_out = {grid_size: None for grid_size in grid_sizes}
              coordconv = CoordConv2D(filters=branch_channels[0], kernel_size=(3,3), strides=1, padding="same",