Unfortunately not, since torch.cat tries to concatenate the tensors in the specified dimension, while all other dimensions should match.
Currently x_p is [batch_size, 128, 56, 56], while up_p is [batch_size, 128, 2, 2].
The error comes most likely from the wrong SaveFeatures tensor.
What is your intention of using self.new_classifier[4] for it? Is it defined as such in a paper or did you just pick this layer?
A quick fix might be to just pool the bigger activation and go with it, but I’m not sure if that’s what you want.
Here are the changes:
# in UnetBlock:
...
x_p = F.adaptive_max_pool2d(x_p, 2)
cat_p = torch.cat([up_p,x_p], dim=1)

# in Resnet4Channel:
self.fc = nn.Linear(1024, num_classes)