I tried to debug your code and had to fix some issues first:

move SaveFeatures out of the class definition
set encoder as an class attribute (self.encoder), since it’s used in forward

uncomment the self.x_unet, since it’s used in forward


After these fixes, you’ll get a spatial size mismatch in your UnetBlock for the current code (2 vs. 56).
Would this info help you debugging this issue?
Are you using Jupyter notebooks or another IDE?