You could reduce the number of channels manually using the pretrained model, but would need to come up with a strategy, how these filters should be reduced.
Each weight
tensor (the kernel or filter) in an nn.Conv2d
layer has 4 dimensions defined as [out_channels=num_filters, in_channels, height, width]
.
While you could reduce the number of filters in e.g. the first layer by using e.g. only the first 32 filters, the filters of the following layer would also need to change their in_channel
dimension. You could of course also slice it, but there might also be other (better) methods to reduce these numbers.