Image channels problem

I have extracted an intermediate layer from VGG16 using my 256x256 image input. The dimension of this intermediate input is [512, 8, 8], therefore 512 channels.

I want to pass this intermediate output into a decoder that expects an input of [32, 8, 8], how can I do this without loss of information e.g. I guess it would not be a good idea to take a 32 channel slice of the 512 channel input?

tl;dr how do I reduce 512 channels to 32?


Add a transform conv layer, e.g.

self.tsf = nn.Conv2d(512,32,1)

1 Like


Thanks, that worked! I added a new module called transform and passed the input into it.