Yes, I don’t think splitting the entire model into nn.Sequential container would easily work (certain, “simple” submodules could work).



 Arda_Tumay:

It seems I need to inherit from its base class to modify its behavior. Am I right?


Yes, I believe this would be the proper way. To do so, check the second link, which points to the base class.



 Arda_Tumay:

What I actually want to achieve is to add new conv2d-relu layers in between fpn and rpn to get proposals to be classified by head.


Assuming these layers won’t change the activation shape (which would thus allow to add them without modifying other layers too), you could try to replace the fpn with an nn.Sequential module containing the fpn as well as the additional layers.