I am building a 3D Unet and here is my model:
UNet(
  (encoder): Encoder(
    (encoding_blocks): ModuleList(
      (0): EncodingBlock(
        (conv1): ConvolutionalBlock(
          (conv_layer): Conv3d(1, 8, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (block): Sequential(
            (0): Conv3d(1, 8, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
          )
        )
        (conv2): ConvolutionalBlock(
          (conv_layer): Conv3d(8, 8, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (dropout_layer): Dropout3d(p=0.3, inplace=False)
          (block): Sequential(
            (0): Conv3d(8, 8, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
            (2): Dropout3d(p=0.3, inplace=False)
          )
        )
        (downsample): MaxPool3d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
      )
      (1): EncodingBlock(
        (conv1): ConvolutionalBlock(
          (conv_layer): Conv3d(8, 16, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (block): Sequential(
            (0): Conv3d(8, 16, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
          )
        )
        (conv2): ConvolutionalBlock(
          (conv_layer): Conv3d(16, 16, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (dropout_layer): Dropout3d(p=0.3, inplace=False)
          (block): Sequential(
            (0): Conv3d(16, 16, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
            (2): Dropout3d(p=0.3, inplace=False)
          )
        )
        (downsample): MaxPool3d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
      )
      (2): EncodingBlock(
        (conv1): ConvolutionalBlock(
          (conv_layer): Conv3d(16, 32, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (block): Sequential(
            (0): Conv3d(16, 32, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
          )
        )
        (conv2): ConvolutionalBlock(
          (conv_layer): Conv3d(32, 32, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (dropout_layer): Dropout3d(p=0.3, inplace=False)
          (block): Sequential(
            (0): Conv3d(32, 32, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
            (2): Dropout3d(p=0.3, inplace=False)
          )
        )
        (downsample): MaxPool3d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
      )
    )
  )
  (decoder): Decoder(
    (decoding_blocks): ModuleList(
      (0): DecodingBlock(
        (upsample): Upsample(scale_factor=2.0, mode=trilinear)
        (conv1): ConvolutionalBlock(
          (conv_layer): Conv3d(64, 32, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (dropout_layer): Dropout3d(p=0.3, inplace=False)
          (block): Sequential(
            (0): Conv3d(64, 32, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
            (2): Dropout3d(p=0.3, inplace=False)
          )
        )
      )
      (1): DecodingBlock(
        (upsample): Upsample(scale_factor=2.0, mode=trilinear)
        (conv1): ConvolutionalBlock(
          (conv_layer): Conv3d(32, 16, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (dropout_layer): Dropout3d(p=0.3, inplace=False)
          (block): Sequential(
            (0): Conv3d(32, 16, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
            (2): Dropout3d(p=0.3, inplace=False)
          )
        )
      )
      (2): DecodingBlock(
        (upsample): Upsample(scale_factor=2.0, mode=trilinear)
        (conv1): ConvolutionalBlock(
          (conv_layer): Conv3d(16, 8, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
          (activation_layer): PReLU(num_parameters=1)
          (dropout_layer): Dropout3d(p=0.3, inplace=False)
          (block): Sequential(
            (0): Conv3d(16, 8, kernel_size=(5, 5, 5), stride=(1, 1, 1), padding=(2, 2, 2))
            (1): PReLU(num_parameters=1)
            (2): Dropout3d(p=0.3, inplace=False)
          )
        )
      )
    )
  )
  (classifier): ConvolutionalBlock(
    (conv_layer): Conv3d(8, 2, kernel_size=(1, 1, 1), stride=(1, 1, 1))
    (dropout_layer): Dropout3d(p=0.3, inplace=False)
    (block): Sequential(
      (0): Conv3d(8, 2, kernel_size=(1, 1, 1), stride=(1, 1, 1))
      (1): Dropout3d(p=0.3, inplace=False)
    )
  )
)

However I got this error:
RuntimeError: Given groups=1, weight of size [16, 32, 5, 5, 5], expected input[1, 48, 120, 120, 120] to have 32 channels, but got 48 channels instead

Can someone tell me where I am wrong? Thanks a lot!