RuntimeError: The size of tensor a (38) must match the size of tensor b (49) at non-singleton dimension 3

File “A1.py”, line 121, in
outputs = model(inputs)
File “/home/shru/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 489, in call
result = self.forward(*input, **kwargs)
File “/home/shru/Nucleus/A1_.py”, line 247, in forward
x3 = self.Att4(d4, x3)
File “/home/shru/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 489, in call
result = self.forward(*input, **kwargs)
File “/home/shru/Nucleus/A1_.py”, line 124, in forward
psi = self.relu(g1 + x1)
RuntimeError: The size of tensor a (38) must match the size of tensor b (49) at non-singleton dimension 3

I’m not sure what your use case is of what your model does exactly, but g1 and x1 cannot be added with different shapes.
If you post the model definition, we could try to help debugging.