Modify detectron2 maskRCNN model to fit in class number?

I’m new to CV and I’m trying to train a model to classify some non-daily-life objects. Following detectron2 official tutorial (the “balloon segmentation”), it works quite smoothly. However, I found some non-official tutorials saying that some layers should be modified according to the class number before training. I wonder if this is necessary on top of modification through the config file. Thanks.