Hi all,
I am setting up a workflow for a training with DenseNet-121. My data is too small in the depth direction and therefore I have to adjust my network. My input is (288 ×288 ×16) so I want to change the 3D average pooling layer (2x2x2) in my 3rd transition layer to a 2D average pooling layer (2x2).
This is the code I am aiming for in the 3rd transition layer:
(transition3): _Transition(
(norm): BatchNorm3d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv): Conv3d(1024, 512, kernel_size=(1, 1, 1), stride=(1, 1, 1), bias=False)
(pool): AvgPool2d(kernel_size=2, stride=2, padding=0)
The problem I am facing is that the input of the AvgPool2D is (18×18×1×512) which is a 3D input, and the AvgPool2D is expecting a 2D input. So I want to ‘squeeze’ (18×18×1×512) to (18×18×512) before using it as input for the pooling layer. However, I do not know how to implement this squeeze function into my transition layer. Does anyone has suggestions on how to fix this problem?
Thanks in advance!