Hi @ptrblck,
Thanks a lot for your help.
I am now passing x to F.upsample_bilinear , which is throwing me this error :
TypeError                                 Traceback (most recent call last)
<ipython-input-25-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-8-a6972b090565> in forward(self, x)
     88         print('final', x.size())
     89 
---> 90         return F.upsample_bilinear(x)
     91         #return F.upsample_bilinear(self.final, x.size()[2:])

/opt/anaconda/lib/python3.6/site-packages/torch/nn/functional.py in upsample_bilinear(input, size, scale_factor)
   1422     # DeprecationWarning is ignored by default
   1423     warnings.warn("nn.functional.upsample_bilinear is deprecated. Use nn.functional.upsample instead.")
-> 1424     return upsample(input, size, scale_factor, mode='bilinear')
   1425 
   1426 

/opt/anaconda/lib/python3.6/site-packages/torch/nn/functional.py in upsample(input, size, scale_factor, mode)
   1373         raise NotImplementedError("Got 4D input, but linear mode needs 3D input")
   1374     elif input.dim() == 4 and mode == 'bilinear':
-> 1375         return _functions.thnn.UpsamplingBilinear2d.apply(input, _pair(size), scale_factor)
   1376     elif input.dim() == 4 and mode == 'trilinear':
   1377         raise NotImplementedError("Got 4D input, but trilinear mode needs 5D input")

/opt/anaconda/lib/python3.6/site-packages/torch/nn/_functions/thnn/upsampling.py in forward(ctx, input, size, scale_factor)
    275             output,
    276             ctx.output_size[0],
--> 277             ctx.output_size[1],
    278         )
    279         return output

TypeError: FloatSpatialUpSamplingBilinear_updateOutput received an invalid combination of arguments - got (int, torch.FloatTensor, torch.FloatTensor, NoneType, NoneType), but expected (int state, torch.FloatTensor input, torch.FloatTensor output, int outputHeight, int outputWidth)