How to obtain the tensor from the middle part of a CNN model (EfficientNet_b0), instead of the last layer?

You could use forward hooks as described e.g. here or manipulate the forward method directly by creating a new module deriving from the EfficientNet_b0 implementation.

1 Like