By wrapping submodules in an nn.Sequential block you are assuming all children are applied sequentially in the original model.
While this might be often the case, some models are a bit more complicated so that this simple container won’t restore the original work flow anymore or will throw an error.
E.g. this .view() operation 1 will be missing, if you are extracting all child modules from this model.
I’m not sure, which module throws the NotImplementedError and it’s a bit strange, as I would expect some shape mismatch etc.
If you just want to remove the last layer, you could replace it with an nn.Identity module.