Hi @tom, sorry for late reply. Thanks a lot for your help.
I downsized x from 256 to 18. But, still having another issue :
This is the error :
Iter:1
x torch.Size([1, 3, 256, 256])
conv1 torch.Size([1, 64, 256, 256])
layer1 torch.Size([1, 256, 256, 256])
layer2 torch.Size([1, 512, 256, 256])
layer3 torch.Size([1, 1024, 256, 256])
layer4 torch.Size([1, 2048, 256, 256])
After downsample x ==>  torch.Size([1, 2048, 18, 18])
/opt/anaconda/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:180: UserWarning: nn.UpsamplingBilinear2d is deprecated. Use nn.Upsample instead.
  warnings.warn("nn.UpsamplingBilinear2d is deprecated. Use nn.Upsample instead.")
layer5a torch.Size([1, 512, 18, 18])
layer5b torch.Size([1, 512, 18, 18])
layer5c torch.Size([1, 512, 18, 18])
layer5d torch.Size([1, 512, 18, 18])
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-32-7d73f3a481fa> in <module>()
      8         targets = Variable(labels)
      9 
---> 10         outputs = model(inputs)
     11         optimizer.zero_grad()
     12         print("outputs size ==> ",outputs.size())

/opt/anaconda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    323         for hook in self._forward_pre_hooks.values():
    324             hook(self, input)
--> 325         result = self.forward(*input, **kwargs)
    326         for hook in self._forward_hooks.values():
    327             hook_result = hook(self, input, result)

<ipython-input-12-f3975da59387> in forward(self, x)
     85             t5c,
     86             t5d,
---> 87         ], 1))
     88 
     89         print('final', x.size())

/opt/anaconda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    323         for hook in self._forward_pre_hooks.values():
    324             hook(self, input)
--> 325         result = self.forward(*input, **kwargs)
    326         for hook in self._forward_hooks.values():
    327             hook_result = hook(self, input, result)

/opt/anaconda/lib/python3.6/site-packages/torch/nn/modules/container.py in forward(self, input)
     65     def forward(self, input):
     66         for module in self._modules.values():
---> 67             input = module(input)
     68         return input
     69 

/opt/anaconda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    323         for hook in self._forward_pre_hooks.values():
    324             hook(self, input)
--> 325         result = self.forward(*input, **kwargs)
    326         for hook in self._forward_hooks.values():
    327             hook_result = hook(self, input, result)

/opt/anaconda/lib/python3.6/site-packages/torch/nn/modules/conv.py in forward(self, input)
    275     def forward(self, input):
    276         return F.conv2d(input, self.weight, self.bias, self.stride,
--> 277                         self.padding, self.dilation, self.groups)
    278 
    279 

/opt/anaconda/lib/python3.6/site-packages/torch/nn/functional.py in conv2d(input, weight, bias, stride, padding, dilation, groups)
     88                 _pair(0), groups, torch.backends.cudnn.benchmark,
     89                 torch.backends.cudnn.deterministic, torch.backends.cudnn.enabled)
---> 90     return f(input, weight, bias)
     91 
     92 




 


RuntimeError: Given groups=1, weight[512, 2048, 3, 3], so expected input[1, 4096, 18, 18] to have 2048 channels, but got 4096 channels instead


​

​

Here is my code for final layer :
self.final = nn.Sequential(
            nn.Conv2d(2048, 512, 3, padding=1, bias=False),
            nn.BatchNorm2d(512, momentum=.95),
            nn.ReLU(inplace=True),
            nn.Dropout(.1),
            nn.Conv2d(512, num_classes, 1),
        )

Could you please help ?
Thanks in advance .