AttributeError: 'FPNCamRoiHeads' object has no attribute 'in_features'

nia: <p>Hi All,</p>
<p>I am trying to reproduce an instance segmentation .using this [tutorial].(<a href="https://github.com/dbtmpl/OPMask" class="inline-onebox" rel="noopener nofollow ugc">GitHub - dbtmpl/OPMask: Official implementation of the paper 'Prior to Segment: Foreground Cues for Weakly Annotated Classes in Partially Supervised Instance Segmentation' (ICCV 2021)</a>) In this case ,it is trying to use the <code>FPNCamRoiHeads</code> model.  However, I get an error for the code. Please find the code below and the respective error.<br>
class FPNCamRoiHeads(StandardROIHeads):<br>
“”"<br>
Copyright (c) Facebook, Inc. and its affiliates.<br>
Adapted Detectron2 class.</p>
<pre><code>Small adjustments to the StandardROIHeads to be able to calculate and process
class activation maps (CAMs)
"""

def __init__(self, cfg, input_shape):
    super().__init__(cfg, input_shape)
    self.cam_res = cfg.MODEL.ROI_MASK_HEAD.POOLER_RESOLUTION

def _init_box_head(self, cfg, input_shape):
    # fmt: off
    pooler_resolution = cfg.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION
    pooler_scales = tuple(1.0 / input_shape[k].stride for k in self.in_features)
    sampling_ratio = cfg.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO
    pooler_type = cfg.MODEL.ROI_BOX_HEAD.POOLER_TYPE
    self.train_on_pred_boxes = cfg.MODEL.ROI_BOX_HEAD.TRAIN_ON_PRED_BOXES
    # fmt: on

    # If StandardROIHeads is applied on multiple feature maps (as in FPN),
    # then we share the same predictors and therefore the channel counts must be the same
    in_channels = [input_shape[f].channels for f in self.in_features]
    # Check all channel counts are equal
    assert len(set(in_channels)) == 1, in_channels
    in_channels = in_channels[0]

    self.box_pooler = ROIPooler(
        output_size=pooler_resolution,
        scales=pooler_scales,
        sampling_ratio=sampling_ratio,
        pooler_type=pooler_type,
    )

    self.box_head = build_box_head(
        cfg,
        ShapeSpec(channels=in_channels, height=pooler_resolution, width=pooler_resolution),
        self.num_classes,
        self.cls_agnostic_bbox_reg,
    )
</code></pre>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/b/8b7ee2b7ec7a6c90ba2329ab5e09ec725294380d.png" data-download-href="https://discuss.pytorch.org/uploads/default/8b7ee2b7ec7a6c90ba2329ab5e09ec725294380d" title="4HMC)Q22}T_N`5Z%EHI4VH"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b7ee2b7ec7a6c90ba2329ab5e09ec725294380d_2_690x160.png" alt="4HMC)Q22}T_N`5Z%EHI4VH" data-base62-sha1="jU2dC3pp5aT118jz6x3VKtnBFA9" width="690" height="160" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b7ee2b7ec7a6c90ba2329ab5e09ec725294380d_2_690x160.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b7ee2b7ec7a6c90ba2329ab5e09ec725294380d_2_1035x240.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b7ee2b7ec7a6c90ba2329ab5e09ec725294380d_2_1380x320.png 2x" data-dominant-color="302F31"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">4HMC)Q22}T_N`5Z%EHI4VH</span><span class="informations">1867×434 65.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>