Avi:

and it seems that the sepapartion of the deeplabv3 model to children, and recombining them together changing the model.


I think that’s a valid concern and I would not recommend to blindly pass all child modules to an nn.Sequential container.
This approach might work fine for simple models, which define and call all modules in a sequential order, but will break for every other use case.
If you want to use this approach, I would recommend to check the original model implementation with the nn.Sequential container and make sure all wanted modules are in the right order.
Alternatively, you can derive a custom class using the base model and redefine the forward as you wish.