I still get a similar error unfortunately.
Since RESNET_ENCODERS is not defined in your code, I swapped it for torchvision.models.resnet50.
In the code you’ve posted, encoders is still just used in forward without being defined. Maybe you’ve defined it somewhere outside your class? I had to store the encoder again as a class attribute, since otherwise it wasn’t found.
Once this was fixed I’ll get the following error:
RuntimeError: Given transposed=1, weight of size [512, 128, 2, 2], expected input[1, 2048, 1, 1] to have 512 channels, but got 2048 channels instead

It looks like the UnetBlock takes the wrong number of channels.
If I define it as
self.x_unet  =  UnetBlock(2048,256,256)

the error vanishes, but the first one comes back:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 2 and 56 in dimension 2 at /opt/conda/conda-bld/pytorch-nightly_1546596893918/work/aten/src/TH/generic/THTensorMoreMath.cpp:1291

This still points to a wrong spatial size in torch.cat.